returns function decodeBase64 ( b64 , raw = false ) { const buff = Buffer . from ( b64 , "base64" ) ; return raw ? new Uint8Array ( buff . buffer , buff . byteOffset , buff . byteLength / Uint8Array . BYTES_PER_ELEMENT ) : buff . toString ( "utf8" ) ; } returns function encodeBytesToBase64 ( bytes ) { return Buffer . from ( bytes . buffer ) . toString ( "base64" ) ; } returns function encodeBase64 ( text ) { return Buffer . from ( text , "utf8" ) . toString ( "base64" ) ; } export function getEncodingResources ( ) { return { "encoding/v1/base64ToBytes" : ( input ) => decodeBase64 ( input , true ) , "encoding/v1/base64ToText" : decodeBase64 , "encoding/v1/bytesToBase64" : encodeBytesToBase64 , "encoding/v1/textToBase64" : encodeBase64 } ; }