说明
* SHA512加密
* OSX下生成的密码不对
代码
#coding=utf-8
"""
Usage:
topwd.py
import random
import crypt
from docopt import docopt
if __name__ == '__main__':
args = docopt(__doc__)
password = args['<password>']
salt_set = ('abcdefghijklmnopqrstuvwxyz'
'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
'0123456789./')
print crypt.crypt(password, '$6${salt}'.format(salt=''.join([random.choice(salt_set) for i in range(8)])))