![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
fast-base64
Advanced tools
Base64 encoding/decoding optimized for speed. Converts base64 to and from Uint8Array
.
node
and deno
.npm install fast-base64
import {toBytes, toBase64} from 'fast-base64';
let bytes = await toBytes('SGVsbG8sIHdvcmxkIQ==');
let base64 = await toBase64(bytes);
We support three versions of the library that have different speed and size trade-offs
fast-base64
: The default is the fastest version, 1.9kB minzipped, async APIfast-base64/small
: Version without SIMD, 1.0kB minzipped, async API, no node
support, 2-3x slowerfast-base64/js
: Fastest pure JS version, 600 bytes minzipped, sync API, 2-30x slowerExample for using the pure JS version:
import {toBytes, toBase64} from 'fast-base64/js';
let bytes = toBytes('SGVsbG8sIHdvcmxkIQ=='); // no `await`!
let base64 = toBase64(bytes);
To support base64url we offer two tiny, fast helper functions (the runtime overhead compared with base64 transcoding itself is negligible):
import {toUrl, fromUrl} from 'fast-base64/url';
let base64url = toUrl('/+A='); // "_-A"
let base64 = fromUrl(base64url); // "/+A="
// you could make our own helper functions for base64url
const toBase64Url = async bytes => toUrl(await toBase64(bytes));
const toBytesUrl = async base64url => await toBytes(fromUrl(base64url));
In making this package, I tried many different approaches for base64 encoding, including using the native atob()
and btoa()
functions and native dataURI functionality. You can find 4 alternative encoding and 3 decoding methods here: https://github.com/mitschabaude/fast-base64/blob/main/base64-alternative.js
Turns out that one of the fastest bytes to base64 implementations in JS uses the good old FileReader API!
async function toBase64DataUri(bytes) {
let reader = new FileReader();
let promise = new Promise(resolve => {
reader.onload = () => resolve(reader.result);
});
let blob = new Blob([bytes.buffer], {type: 'application/octet-stream'});
reader.readAsDataURL(blob);
return (await promise).replace('data:application/octet-stream;base64,', '');
}
FAQs
Fastest possible base64 encoding/decoding using WebAssembly
The npm package fast-base64 receives a total of 3 weekly downloads. As such, fast-base64 popularity was classified as not popular.
We found that fast-base64 demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.