
Security News
Crates.io Implements Trusted Publishing Support
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
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,913 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.
Security News
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
Research
/Security News
Undocumented protestware found in 28 npm packages disrupts UI for Russian-language users visiting Russian and Belarusian domains.
Research
/Security News
North Korean threat actors deploy 67 malicious npm packages using the newly discovered XORIndex malware loader.