The `thirty-two` package provides an implementation of the Base32 encoding and decoding algorithms as specified in RFC 3548 for Node.js environments. Base32 is a binary-to-text encoding scheme that uses a 32-character alphabet, commonly employed for situations where human readability or case-insensitivity is desired, and URL-safety is important (as it avoids common punctuation characters). While RFC 3548 has been obsoleted by RFC 4648, the core Base32 encoding defined within it remains a standard and widely used method. This package, currently at version 1.0.2 and last updated approximately 10 years ago, is a mature and stable utility that fulfills its specific function without active feature development, operating effectively in maintenance mode. It's a foundational library for basic binary data transformation.
npm install thirty-twoVerified import paths — ran on the pinned version, not inferred.
Demonstrates how to encode and decode both regular strings and binary data (Buffers) using the `thirty-two` library, illustrating basic usage.
Use `const base32 = require('thirty-two');` in CommonJS projects. In ESM, use `import base32 from 'thirty-two';`. If encountering issues, consider a more modern Base32 library with explicit ESM support.After decoding with `base32.decode(encodedString)`, always append `.toString('utf8')` (or another appropriate encoding) to the result if you expect a string: `base32.decode(encodedString).toString('utf8')`.Verify that the specific Base32 alphabet and padding rules implemented by `thirty-two` (RFC 3548) are suitable for your target system. If strict RFC 4648 compliance or other Base32 variants (e.g., Crockford's Base32, z-base-32) are needed, you might need a different library.
Import the entire object and access its methods: `const base32 = require('thirty-two'); base32.encode(...);` or `import base32 from 'thirty-two'; base32.encode(...);`.Ensure that the input argument to `encode` or `decode` is always a `string` or a `Buffer` instance. For example, `base32.encode(String(yourValue))` or `base32.encode(Buffer.from(yourBinaryData))`.
No dependency data recorded yet.