PasswordHash: Difference between revisions
Jump to navigation
Jump to search
m (add salt rounds guidance link) |
|||
Line 19: | Line 19: | ||
===Options for each hashing algorithm=== | ===Options for each hashing algorithm=== | ||
* ''bcrypt'': | * ''bcrypt'': | ||
** ''cost'' (int), default: 10 | ** ''cost'' (int), default: 10. Visit [http://security.stackexchange.com/questions/17207/recommended-of-rounds-for-bcrypt this link] to determine the number of rounds appropriate for your server. | ||
** ''salt'' (string), default: automatically generate salt | ** ''salt'' (string), default: automatically generate salt | ||
*** an empty string will automatically generate a salt with the ''cost'' provided | *** an empty string will automatically generate a salt with the ''cost'' provided |
Revision as of 21:40, 16 April 2017
This template is no longer in use as it results in poor readability. This function creates a new password hash using a specified hashing algorithm.
Syntax
string passwordHash ( string password, string algorithm [, table options = {} ] )
Required Arguments
- password: The password to hash.
- algorithm: The algorithm to use:
- bcrypt: use the bcrypt hashing algorithm
Optional Arguments
- options: table with options for the hashing algorithm, as detailed below
Options for each hashing algorithm
- bcrypt:
- cost (int), default: 10. Visit this link to determine the number of rounds appropriate for your server.
- salt (string), default: automatically generate salt
- an empty string will automatically generate a salt with the cost provided
- if a string is provided, the given salt is used (do not do this!)
Returns
Returns the hash as a string if hashing was successful, false otherwise.
Example
Script Example Missing Function PasswordHash needs a script example, help out by writing one. | |
Before submitting check out Editing Guidelines Script Examples. |
-- TODO
See Also
- addDebugHook
- base64Decode
- base64Encode
- debugSleep
- decodeString
- encodeString
- fromJSON
- generateKeyPair
- getColorFromString
- getDevelopmentMode
- getDistanceBetweenPoints2D
- getDistanceBetweenPoints3D
- getEasingValue
- getNetworkStats
- getNetworkUsageData
- getPerformanceStats
- getRealTime
- getTickCount
- getTimerDetails
- getTimers
- getFPSLimit
- getUserdataType
- getVersion
- gettok
- isTransferBoxVisible
- setTransferBoxVisible
- hash
- inspect
- interpolateBetween
- iprint
- isOOPEnabled
- isTimer
- killTimer
- md5
- passwordHash
- passwordVerify
- pregFind
- pregMatch
- pregReplace
- removeDebugHook
- resetTimer
- setDevelopmentMode
- setFPSLimit
- setTimer
- ref
- deref
- sha256
- split
- teaDecode
- teaEncode
- toJSON
- tocolor
- getProcessMemoryStats
- utfChar
- utfCode
- utfLen
- utfSeek
- utfSub
- bitAnd
- bitNot
- bitOr
- bitXor
- bitTest
- bitLRotate
- bitRRotate
- bitLShift
- bitRShift
- bitArShift
- bitExtract
- bitReplace