base32-codecs
is a codecs compatible adapter to base32-encode and base32-decode.
const {
base32, // RFC4648, unpadded
base32c, // Crockford
base32h, // RFC4648-HEX, unpadded
base32hp, // RFC4648-HEX, padded
base32p // RFC4648, Padded
} = require('base32-codecs')
for (const codec of [base32, base32c, base32h, base32hp, base32p]) {
codec.encode(
codec.decode(crypto.randomBytes(10))
)
}