Last active
November 14, 2025 20:48
-
-
Save nichoth/65a4c3cfa93adaf46ac5b2db4c26467e to your computer and use it in GitHub Desktop.
Base64 tricks
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
| function fromUrlEncoded (base64url:string):Record<string, any> { | |
| const base64Url = token.split('.')[1]; | |
| const base64 = base64Url.replace(/-/g, '+').replace(/_/g, '/'); | |
| return JSON.parse(atob(base64)); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment