Created
February 18, 2014 15:33
-
-
Save arnauorriols/9073232 to your computer and use it in GitHub Desktop.
Python replacement for Encode.java used in OpenAM
This file contains 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
# Python replacement for Encode.java used in OpenAM | |
# | |
# Author: Arnau orriols | |
from hashlib import sha1 | |
from base64 import b64encode | |
from sys import argv | |
def encode(string): | |
return b64encode(sha1(string).digest()) | |
if __name__ == "__main__": | |
if len(argv) == 2: | |
print encode(argv[1]) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment