PasswordHash
Jump to navigation
Jump to search
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.