Skip to content

Instantly share code, notes, and snippets.

@pbteja1998
Created January 22, 2018 17:59
Show Gist options
  • Save pbteja1998/94853812de77f3b00ff45577318af7b6 to your computer and use it in GitHub Desktop.
Save pbteja1998/94853812de77f3b00ff45577318af7b6 to your computer and use it in GitHub Desktop.
def hash_data(data):
'''
param: data b64encoded data
return: SHA256 base64 encoded hash
'''
from base64 import b64decode
from Crypto.Hash import SHA256
hashed_data = SHA256.new()
hashed_data.update(b64decode(data))
return hashed_data
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment