
Research
/Security News
Contagious Interview Campaign Escalates With 67 Malicious npm Packages and New Malware Loader
North Korean threat actors deploy 67 malicious npm packages using the newly discovered XORIndex malware loader.
base32-encoding
Advanced tools
Encode / decode base32. Supports Buffers, strings, custom alphabets, abstract-encoding compliant
base32-encoding
Encode / decode base32. Supports Buffers, strings, custom alphabets, abstract-encoding compliant
var base32 = require('base32-encoding')
var buf = crypto.randomBytes(32)
var b32 = base32.encode(buf)
var b256 = base32.decode(b32)
var str = base32.stringify(buf) // base32.encode then convert to string
var origBuf = base32.parse(str) // convert from string then base32.decode
var output = base32.encode(buf, [output], [offset])
Encode a normal Buffer
as base32, meaning only the lower 5 bits are used.
Takes ⌈len * 8 / 5⌉
bytes to encode. Takes optional Buffer
output
instead
of allocating a new Buffer
internally, and writes at optional offset
.
Returns output
. Sets base32.encode.bytes
to the number of bytes written.
var output = base32.decode(buf, [output], [offset])
Decode a base32 Buffer
as a normal, "base256" Buffer
, meaning only the lower
5 bits are read from buf
and assembled into complete 8 bit bytes.
Takes ⌊len * 5 / 8⌋
bytes to encode. Takes optional Buffer
output
instead
of allocating a new Buffer
internally, and writes at optional offset
.
Returns output
. Sets base32.decode.bytes
to the number of bytes written.
var len = base32.encodingLength(buf)
Returns ⌈len * 8 / 5⌉
.
var str = base32.stringify(buf, [alphabet])
Encode buf
to base32 and translate into a string using optional alphabet
.
alphabet
defaults to 23456789abcdefghijkmnpqrstuvwxyz
(missing o01l
).
var buf = base32.parse(str, [alphabet])
Decode str
from base32 and translate from a string using optional alphabet
.
alphabet
defaults to 23456789abcdefghijkmnpqrstuvwxyz
(missing o01l
).
npm install base32-encoding
FAQs
Encode / decode base32. Supports Buffers, strings, custom alphabets, abstract-encoding compliant
The npm package base32-encoding receives a total of 2,040 weekly downloads. As such, base32-encoding popularity was classified as popular.
We found that base32-encoding 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.
Research
/Security News
North Korean threat actors deploy 67 malicious npm packages using the newly discovered XORIndex malware loader.
Security News
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
Security News
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.