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
OZ has a great Base64 encoder. (And, as far as I can tell, the only audited one.)
There's a lot of interest in passkey-based wallets now, which offer an excellent self-custody UX. These rely on the WebAuthn standard, which uses Base64URL.
For that use case and for completeness, it would be great to have a canonical, audited onchain Base64URL encoder.
📝 Details
Encoding
Input
Output
Base64
hello world
aGVsbG8gd29ybGQ=
Base64URL
hello world
aGVsbG8gd29ybGQ
I think this can be done with contract derived from Base64.sol with two straightforward modifications:
Change two characters in the lookup table
Remove the trailing = padding
If there's interest, I'm happy to send a PR.
The text was updated successfully, but these errors were encountered:
🧐 Motivation
OZ has a great Base64 encoder. (And, as far as I can tell, the only audited one.)
There's a lot of interest in passkey-based wallets now, which offer an excellent self-custody UX. These rely on the WebAuthn standard, which uses Base64URL.
For that use case and for completeness, it would be great to have a canonical, audited onchain Base64URL encoder.
📝 Details
hello world
aGVsbG8gd29ybGQ=
hello world
aGVsbG8gd29ybGQ
I think this can be done with contract derived from
Base64.sol
with two straightforward modifications:=
paddingIf there's interest, I'm happy to send a PR.
The text was updated successfully, but these errors were encountered: