
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
bytes-base64
Advanced tools
For converting between Uint8Array and Base64 strings. This library is primarily developed for WeChat Mini Programs and has been verified to work on mini programs.
Node.js, browser, and WeChat Mini ProgramsJest用于 Uint8Array 和 Base64 字符串的相互转换,此库主要为微信小程序开发,已在小程序上验证。
Node.js、浏览器,以及微信小程序Jest 测试NPM
npm i bytes-base64
YARN
yarn add bytes-base64
import { bytesToBase64, base64ToBytes } from 'bytes-base64';
test('[1]', () => {
const base64 = 'SGVsbG8gd29ybGQ=';
const bytes = base64ToBytes(base64);
expect(bytes).toEqual(new Uint8Array([72, 101, 108, 108, 111, 32, 119, 111, 114, 108, 100]));
});
test('[2]', () => {
const bytes = new Uint8Array([72, 101, 108, 108, 111, 32, 119, 111, 114, 108, 100]);
const base64 = bytesToBase64(bytes);
expect(base64).toBe('SGVsbG8gd29ybGQ=');
});
test('[3]', () => {
const bytes = base64ToBytes('SGVsbG8gd29ybGQ=');
const base64 = bytesToBase64(bytes);
expect(base64).toBe('SGVsbG8gd29ybGQ=');
});
test('[4]', () => {
const bytes = new Uint8Array([72, 101, 108, 108, 111, 32, 119, 111, 114, 108, 100]);
const base64 = bytesToBase64(bytes);
const decodedBytes = base64ToBytes(base64);
expect(decodedBytes).toEqual(bytes);
});
FAQs
Uint8Array <-> Base64, very small size library
The npm package bytes-base64 receives a total of 5 weekly downloads. As such, bytes-base64 popularity was classified as not popular.
We found that bytes-base64 demonstrated a healthy version release cadence and project activity because the last version was released less than 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.