📅  最后修改于: 2022-03-11 14:45:32.185000             🧑  作者: Mango
from hashlib import scrypt
from os import urandom
from base64 import urlsafe_b64encode
salt = urandom(16)
key = scrypt(b'password', salt=salt, n=16384, r=8, p=1, dklen=32)
key_encoded = urlsafe_b64encode(key)