
Product
A New Design for GitHub PR Comments
We redesigned our GitHub PR comments to deliver clear, actionable security insights without adding noise to your workflow.
node-buffer-encoding
Advanced tools
A little wrapper around Node's Buffer that provides encoding/decoding for all supported encodings.
A little wrapper around Node's Buffer that provides encoding/decoding for all supported encodings.
If you have access to Node's Buffer you probably just want to use it directly instead. This module provides a unified API to some of my other modules, and allows me not to import "@types/node" everywhere.
npm install node-buffer-encoding
import Encoding from 'node-buffer-encoding';
// Encode an Uint8Array with the given encoding
Encoding.encode ( new Uint8Array ([ 0, 255 ]), 'hex' ); // => '00ff'
// Encode a string with the given encoding
Encoding.encodeStr ( 'hello', 'base64' ); // => 'aGVsbG8='
// Decode a string with the given encoding to an Uint8Array
Encoding.decode ( '00ff', 'hex' ); // => Uint8Array(2) [ 0, 255 ]
// Decode a string with the given encoding to a string
Encoding.decodeStr ( 'aGVsbG8=', 'base64' ); // => 'hello'
MIT © Fabio Spampinato
FAQs
A little wrapper around Node's Buffer that provides encoding/decoding for all supported encodings.
The npm package node-buffer-encoding receives a total of 2,831 weekly downloads. As such, node-buffer-encoding popularity was classified as popular.
We found that node-buffer-encoding demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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.
Product
We redesigned our GitHub PR comments to deliver clear, actionable security insights without adding noise to your workflow.
Product
Our redesigned Repositories page adds alert severity, filtering, and tabs for faster triage and clearer insights across all your projects.
Security News
Slopsquatting is a new supply chain threat where AI-assisted code generators recommend hallucinated packages that attackers register and weaponize.