import hashlib
import base64

res = ‘121212’
print res

md = hashlib.md5(s)
res = md.hexdigest()

res = base64.b64encode(s)

sha = hashlib.sha1(s)
res = sha.hexdigest()