Skip to content

Instantly share code, notes, and snippets.

@ragnard
Created December 5, 2023 19:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ragnard/0c629d584221af49b26ad43a72c9b4bd to your computer and use it in GitHub Desktop.
Save ragnard/0c629d584221af49b26ad43a72c9b4bd to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
decode_base64() {
echo -n "$1" | tr -d - | tr _ / | base64 -d 2>/dev/null
}
IFS='.' read header payload signature <&0
echo $(decode_base64 $header)
echo $(decode_base64 $payload)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment