login

local lud = require "ludweb"

local function get_salt()
    return lud.crypt.urandom(32)
end

local function hash_pass(pass, salt)
    return lud.crypt.pbkdf2(pass, salt, 10000, 64)
end

return {
    b64_enc=lud.crypt.b64_enc, b64_dec=lud.crypt.b64_dec, hex=lud.crypt.hex,
    uuid4=lud.crypt.uuid4, get_salt=get_salt, hash_pass=hash_pass
}