@ngriffin_uk/auth-encoding
v0.2.4
Published
Runtime-neutral authentication encoding primitives
Readme
@ngriffin_uk/auth-encoding
Strict base16/hex, base32, base64, and base64url codecs.
pnpm add @ngriffin_uk/auth-encodingimport {
decodeBase64Url,
encodeBase32,
encodeBase64Url,
} from "@ngriffin_uk/auth-encoding";
const token = encodeBase64Url(bytes);
const restored = decodeBase64Url(token);
const otpSecret = encodeBase32(bytes);Malformed encodings throw TypeError rather than being decoded permissively.
