Last active
February 8, 2020 13:46
-
-
Save jobel-code/4ab21c4e4dad1628b8d5441943c19ff3 to your computer and use it in GitHub Desktop.
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 | |
| import hashlib | |
| input = "string to encode" | |
| result = base64.b64encode(hashlib.sha1(str.encode(input))) | |
| print(result) | |
| # Google Cloud Storage transfer requires a base64-encoded MD5 hash of 24 characters long | |
| hash = hashlib.md5() | |
| hash.update('string_chunk') | |
| hash.digest().encode('base64').strip() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment