Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
base64-binary
Advanced tools
A polyfill built upon atob/btoa (browser side only) so as to support base64 to/from binary (Uint8Array/ArrayBuffer) conversion
A polyfill built upon atob/btoa (browser) so as to support base64 to/from binary (Uint8Array/ArrayBuffer) conversion
It seems that the built-in atob and btoa functions don't support encoding binary (Uint8Array or ArrayBuffer) to base64 string and decoding base64 string to binary directly. However, with the help of this polyfill which adds a thin layer to make extra conversion between String and Uint8Array, we can make it by standing on the shoulders of giants.
Add reference in your HTML file
...
<script type="text/javascript" src="/path/to/base64-lite.js"></script>
...
Now you can make base64 codec for binary data
const bin = base64.decode("hzw4NdSJ0NzaEKo9hSKiH+X5ViFAh+hmYDuorCqDjEk=");
console.log(base64.encode(bin));
Browser with ES5 support
Written in 2019 by tibetty xihua.duan@gmail.com
FAQs
A polyfill built upon atob/btoa (browser side only) so as to support base64 to/from binary (Uint8Array/ArrayBuffer) conversion
The npm package base64-binary receives a total of 22 weekly downloads. As such, base64-binary popularity was classified as not popular.
We found that base64-binary 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
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.