17 lines
323 B
Lua
17 lines
323 B
Lua
local auth = {}
|
|
|
|
local ls = require "luasodium"
|
|
|
|
function auth.digest(password)
|
|
return ls.crypto_pwhash_str(
|
|
password,
|
|
ls.crypto_pwhash_OPSLIMIT_INTERACTIVE,
|
|
ls.crypto_pwhash_MEMLIMIT_INTERACTIVE)
|
|
end
|
|
|
|
function auth.verify(password, hash)
|
|
return ls.crypto_pwhash_str_verify(hash, password)
|
|
end
|
|
|
|
return auth
|