-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature request] Raw & Base64 support #23
Comments
I find this simple snippet from stackoverflow to convert hex to base64: btoa("4142434445464748494a4b4c4d4e4f505152535455565758595a".match(/\w{2}/g).map(function(a){return String.fromCharCode(parseInt(a, 16));} ).join("")) It is going to fix my problem. |
The following works for me as of React Native 0.70.5:
|
it would still be nice to have support for base64 straight from the module. |
One solution is to import the Buffer class like this: import { Buffer } from 'buffer';
const base64 = Buffer.from(hex, 'hex').toString('base64'); I don't know where this package came from, maybe it's a native library in react native. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is it possible to provide raw, base64, and/or base64url output support as well. This is will be handy for implementing OAuth clients, for example.
The text was updated successfully, but these errors were encountered: