Authentication
Bindings for the crypto_auth API. See the libsodium crypto_auth docs for more information.
Constants
Buffer lengths (integer)
crypto_auth_BYTEScrypto_auth_KEYBYTES
String constants (string)
crypto_auth_PRIMITIVE
crypto_auth
sodium.crypto_auth(out, in, k)
Creates an authentication token.
outshould be abufferof lengthcrypto_auth_BYTESinshould be abufferof any sizekshould be abufferof lengthcrypto_auth_KEYBYTES
The generated token is stored in out.
crypto_auth_verify
var bool = sodium.crypto_auth_verify(out, in, k)
Verifies a token.
outshould be abufferof lengthcrypto_auth_BYTESinshould be abufferof any sizekshould be abufferof lengthcrypto_auth_KEYBYTES
Returns true if the token could be verified. Otherwise false.
