91 -- apply SASLprep |
91 -- apply SASLprep |
92 username = saslprep(username); |
92 username = saslprep(username); |
93 return username; |
93 return username; |
94 end |
94 end |
95 |
95 |
96 local function hashprep( hashname ) |
96 local function hashprep(hashname) |
97 local hash = hashname:lower() |
97 return hashname:lower():gsub("-", "_"); |
98 hash = hash:gsub("-", "_") |
|
99 return hash |
|
100 end |
98 end |
101 |
99 |
102 function saltedPasswordSHA1(password, salt, iteration_count) |
100 function saltedPasswordSHA1(password, salt, iteration_count) |
103 local salted_password |
101 local salted_password |
104 if type(password) ~= "string" or type(salt) ~= "string" or type(iteration_count) ~= "number" then |
102 if type(password) ~= "string" or type(salt) ~= "string" or type(iteration_count) ~= "number" then |