Created
April 3, 2018 11:41
-
-
Save tsavola/1efbf6de95ff8dd1fa0701ae28c21b20 to your computer and use it in GitHub Desktop.
Python 2/3 oneliner for printing an URL-safe base-64 SHA-384 digest of file contents.
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
import base64, hashlib, sys; h = hashlib.new("sha384"); h.update(open(sys.argv[1], "rb").read()); print(base64.urlsafe_b64encode(h.digest()).decode()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment