PasswordHash: Difference between revisions
Jump to navigation
Jump to search
Update Lua API reference |
Complete Lua function catalog |
||
| Line 37: | Line 37: | ||
* Never send plaintext passwords to other clients or include them in logs. | * Never send plaintext passwords to other clients or include them in logs. | ||
[[Category:Lua Functions]] | |||
[[Category:Server Functions]] | [[Category:Server Functions]] | ||
[[Category:Utility Functions]] | [[Category:Utility Functions]] | ||
Latest revision as of 09:54, 15 August 2026
passwordHash
Queues an asynchronous Argon2id password hash operation.
Syntax
number|false passwordHash(string password, function callback)
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
password |
string |
yes | The password to hash, from 1 to 256 bytes. |
callback |
function |
yes | Called as callback(success, encodedHash, error).
|
Returns
Returns a numeric request identifier when queued, or false when validation, service availability, or queue limits reject the request.
Examples
Hash a password before storing an account:
passwordHash(password, function(success, encodedHash, errorMessage)
if not success then
outputDebugString(errorMessage or "Password hashing failed")
return
end
-- Store encodedHash in the server database.
end)
Notes
- Available only in server-side resource scripts.
- Hashing runs on the bounded password worker service and does not block the server tick.
- Never send plaintext passwords to other clients or include them in logs.