openpolitics.com

  • writing
  • quotes
  • Topics
    • academia
    • corruption
    • economics
    • education
    • environment
    • finance
    • history
    • hypertext
    • media
    • philosophy
    • psychology
    • religion
    • russia
    • ted nelson
  • about
← Previous Next →

python: base 64 encode the sha1 hash of a string

>>> import base64
>>> import hashlib
>>> base64.b64encode(hashlib.sha1(“test”).digest())
‘qUqP5cyxm6YcTAhz05Hph5gvu9M=’

base64.b64encode(password_hash.encode(‘utf-8’))