crypt.derive

Documentation of Synapse Z crypt.derive library

crypt.derive.key

string crypt.derive.key(result_size: number, key: string, id: <string/number>, context: string?)

if id is a number then context is required to perform libsodium kfd key derivation

else performs a blake2b_sha512 with the specified key and id

crypt.derive.password

string crypt.derive.password(result_size: number, password: string, salt: string, type: number)

uses libsodium pwhash

type can be any of following:

TypeNameTypeValueDescription
Interactive0Fastest type of pwhash
Moderate1Second fastest type of pwhash
Sensitive2Slowest type of pwhash, used for advanced password hashing