category param { ArrayBuffer | Uint8Array } b returns { string } export function encodeBase64 ( b ) { return Buffer . from ( b ) . toString ( 'base64' ) ; } category param { ArrayBuffer | Uint8Array } b returns { string } export function encodeUnpaddedBase64 ( b ) { return encodeBase64 ( b ) . replace ( /=+/g , '' ) ; } category param { ArrayBuffer | Uint8Array } b returns { string } export function encodeUnpaddedUrlSafeBase64 ( b ) { return encodeUnpaddedBase64 ( b ) . replace ( /\+/g , '-' ) . replace ( /\//g , '_' ) ; } category param { string } s returns { Uint8Array } export function decodeBase64 ( s ) { return Buffer . from ( s , 'base64' ) ; } category param { string } s returns { Uint8Array } export function decodeUnpaddedBase64 ( s ) { return decodeBase64 ( s ) ; } category param { string } s returns { Uint8Array } export function decodeUnpaddedUrlSafeBase64 ( s ) { return decodeUnpaddedBase64 ( s . replace ( /-/g , '+' ) . replace ( /_/g , '/' ) ) ; }