dataset/seed/applicationservice/2022.03.08/dovecot/funcs/dovecot.py
2022-03-08 19:42:28 +01:00

9 lines
308 B
Python

from crypt import crypt as _crypt
from string import ascii_letters as _ascii_letters, digits as _digits
from secrets import choice as _choice
def sha512_crypt(password):
salt = ''.join([_choice(_ascii_letters + _digits) for _ in range(8)])
prefix = '$6$'
return _crypt(password, prefix + salt)