Skip to content

Instantly share code, notes, and snippets.

@tsloughter
Created April 20, 2014 14:40
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 tsloughter/11115747 to your computer and use it in GitHub Desktop.
Save tsloughter/11115747 to your computer and use it in GitHub Desktop.
Python:
>>> urlsafe_b64encode(hmac.new("secret", "message", sha256).digest())
'i19IcCmVwVmMVz2x4hhmqbgl1KeU0WnXBgoDYFeWNgs='
Haskell:
> B64.encode . B.pack . showDigest $ hmacSha256 "secret" "message"
"OGI1ZjQ4NzAyOTk1YzE1OThjNTczZGIxZTIxODY2YTliODI1ZDRhNzk0ZDE2OWQ3MDYwYTAzNjA1Nzk2MzYwYg=="
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment