You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We should review if these utils are needed in the library, otherwise move them over to the clients monorepo.
Regardless, the following refactoring should be done:
Remove the binary string variants encodeUtf8 and decodeUtf8
Accept/return Uint8Arrays for base64 encoding/decoding
Remove encodeUtf8Base64 and decodeUtf8Base64 (they can just chain two functions)
decodeBase64 (or base64ToBytes/Array) should return a Uint8Array, and then utf8BytesToString should take a Uint8Array and return a string, so that utf8BytesToString ∘ base64ToBytes == decodeUtf8Base64.
And then if binary strings are needed in some cases, binaryStringToArray / arrayToBinaryString can be used.
The text was updated successfully, but these errors were encountered:
We should review if these utils are needed in the library, otherwise move them over to the clients monorepo.
Regardless, the following refactoring should be done:
encodeUtf8
anddecodeUtf8
encodeUtf8Base64
anddecodeUtf8Base64
(they can just chain two functions)decodeBase64
(orbase64ToBytes/Array
) should return a Uint8Array, and thenutf8BytesToString
should take aUint8Array
and return a string, so thatutf8BytesToString ∘ base64ToBytes == decodeUtf8Base64
.And then if binary strings are needed in some cases,
binaryStringToArray
/arrayToBinaryString
can be used.The text was updated successfully, but these errors were encountered: