Created
September 25, 2015 20:12
-
-
Save dfcarpenter/2c49bcaf875a9909e692 to your computer and use it in GitHub Desktop.
decoding
This file contains 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
iex(1)> decode = "bm9uY2U9Y2JlYTQ1NGQyYjNiYmQyZTI1OTQ2YzNkYT\nViOTM5OWYmcmV0dXJu\nX3Nzb191cmw9aHR0cCUzQSUyRiUyRmZvcnVtcy5zdHJpbmdpZnkuY29tJTJG\nc2Vzc2lvbiUyRnNzb19sb2dpbg==\n" | |
"bm9uY2U9Y2JlYTQ1NGQyYjNiYmQyZTI1OTQ2YzNkYT\nViOTM5OWYmcmV0dXJu\nX3Nzb191cmw9aHR0cCUzQSUyRiUyRmZvcnVtcy5zdHJpbmdpZnkuY29tJTJG\nc2Vzc2lvbiUyRnNzb19sb2dpbg==\n" | |
iex(2)> Base.decode64! decode | |
** (ArgumentError) non-alphabet digit found: | |
(elixir) lib/base.ex:111: Base.dec64/1 | |
(elixir) lib/base.ex:518: Base."-do_decode64/2-lbc$^0/2-0-"/3 | |
(elixir) lib/base.ex:518: Base.do_decode64/2 | |
iex(2)> Base.url_decode64! decode | |
** (ArgumentError) non-alphabet digit found: | |
(elixir) lib/base.ex:111: Base.dec64url/1 | |
(elixir) lib/base.ex:518: Base."-do_decode64/2-lbc$^0/2-0-"/3 | |
(elixir) lib/base.ex:518: Base.do_decode64/2 | |
iex(2)> |
This file contains 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
> var decode = 'bm9uY2U9Y2JlYTQ1NGQyYjNiYmQyZTI1OTQ2YzNkYTViOTM5OWYmcmV0dXJu\nX3Nzb191cmw9aHR0cCUzQSUyRiUyRmZvcnVtcy5zdHJpbmdpZnkuY29tJTJG\nc2Vzc2lvbiUyRnNzb19sb2dpbg==\n' | |
undefined | |
> var coded = new Buffer(decode, 'base64').toString() | |
undefined | |
> coded | |
'nonce=cbea454d2b3bbd2e25946c3da5b9399f&return_sso_url=http%3A%2F%2Fforums.stringify.com%2Fsession%2Fsso_login' | |
> |
This file contains 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 base64 | |
>>> coded = 'bm9uY2U9Y2JlYTQ1NGQyYjNiYmQyZTI1OTQ2YzNkYTViOTM5OWYmcmV0dXJu\nX3Nzb191cmw9aHR0cCUzQSUyRiUyRmZvcnVtcy5zdHJpbmdpZnkuY29tJTJG\nc2Vzc2lvbiUyRnNzb19sb2dpbg==\n' | |
>>> coded | |
'bm9uY2U9Y2JlYTQ1NGQyYjNiYmQyZTI1OTQ2YzNkYTViOTM5OWYmcmV0dXJu\nX3Nzb191cmw9aHR0cCUzQSUyRiUyRmZvcnVtcy5zdHJpbmdpZnkuY29tJTJG\nc2Vzc2lvbiUyRnNzb19sb2dpbg==\n' | |
>>> base64.b64decode(coded) | |
'nonce=cbea454d2b3bbd2e25946c3da5b9399f&return_sso_url=http%3A%2F%2Fforums.stringify.com%2Fsession%2Fsso_login' | |
>>> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment