Created
June 29, 2021 15:42
-
-
Save s1r-J/b0ce7e46b159bccd75a205fc49548158 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import base64url from 'base64url'; | |
function arraybuffer2base64url(ab) { | |
return base64url.encode(Buffer.from(ab), 'utf8'); | |
} | |
function base64url2arraybuffer(b64u) { | |
let buf = base64url.toBuffer(b64u); | |
return this.buffer2arraybuffer(buf); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment