19 lines
686 B
Plaintext
19 lines
686 B
Plaintext
:sig
|
|
String password_hash(String password)
|
|
|
|
:params
|
|
password : password bytes to hash
|
|
return value : self-contained scrypt encoding, or an empty string on failure
|
|
|
|
:content
|
|
Creates a password credential with a cryptographically random salt and UCE's current bounded scrypt parameters. Store the returned encoding exactly as produced. An empty result means hashing failed; abort the credential write and report an operational error instead of storing it.
|
|
|
|
:example
|
|
String encoded = password_hash("correct horse battery staple");
|
|
print(encoded != "" && password_verify("correct horse battery staple", encoded) ? "valid" : "failed", "\n");
|
|
|
|
:see
|
|
>sys
|
|
password_verify
|
|
password_needs_rehash
|