UNPKG

@hazae41/base64

Version:

Base64 adapter for JS implementations

22 lines (19 loc) 616 B
'use strict'; function fromNative() { return { encodePaddedOrThrow(bytes) { return bytes.toBase64({ alphabet: "base64url" }); }, decodePaddedOrThrow(text) { return Uint8Array.fromBase64(text, { alphabet: "base64url" }); }, encodeUnpaddedOrThrow(bytes) { return bytes.toBase64({ alphabet: "base64url", omitPadding: true }); }, decodeUnpaddedOrThrow(text) { return Uint8Array.fromBase64(text, { alphabet: "base64url" }); } }; } exports.fromNative = fromNative; //# sourceMappingURL=index.cjs.map