Sha256: Difference between revisions
Jump to navigation
Jump to search
UniOnDennis (talk | contribs) (Created page with "__NOTOC__ {{Server client function}} {{MessageBox| bordercolorhex = FF0000 | bordertype = dotted | bgcolorhex = CCCCFF | image = File:Dialog-information.png | tit...") |
m (Добавление языков) |
||
(9 intermediate revisions by 6 users not shown) | |||
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
{{Server client function}} | {{Server client function}} | ||
{{Tip| | |||
{{ | * The sha module and this function may conflict with eachother, if you use this function uninstall the module! | ||
* This function returns an uppercase string, so make sure you string.upper() anything else you are checking against that has been sha256'd elsewhere.}} | |||
}} | |||
Calculates the sha256 hash of the specified string. | Calculates the sha256 hash of the specified string. | ||
==Syntax== | ==Syntax== | ||
Line 25: | Line 15: | ||
===Returns=== | ===Returns=== | ||
Returns the sha256 hash of the input string if successful, ''false'' otherwise. | Returns the sha256 hash of the input string if successful, ''false'' otherwise. | ||
==Requirements== | |||
{{Requirements|1.3.1-9.04836|1.3.1-9.04836|}} | |||
==Example== | ==Example== | ||
Line 31: | Line 24: | ||
function ( thePlayer, command, input ) | function ( thePlayer, command, input ) | ||
if ( input ) then -- Check if the string exist | if ( input ) then -- Check if the string exist | ||
local | local sha256hash = sha256( input ) -- Generate the hash | ||
outputChatBox( | outputChatBox( sha256hash ) -- Output the hash in the chat | ||
end | end | ||
end | end | ||
Line 40: | Line 33: | ||
==See Also== | ==See Also== | ||
{{Utility functions}} | {{Utility functions}} | ||
[[en:sha256]] | |||
[[ru:sha256]] |
Latest revision as of 16:29, 12 April 2021
Tip:
|
Calculates the sha256 hash of the specified string.
Syntax
string sha256 ( string str )
Required Arguments
- str: the string to hash.
Returns
Returns the sha256 hash of the input string if successful, false otherwise.
Requirements
Minimum server version | 1.3.1-9.04836 |
---|---|
Minimum client version | 1.3.1-9.04836 |
Note: Using this feature requires the resource to have the above minimum version declared in the meta.xml <min_mta_version> section. e.g. <min_mta_version server="1.3.1-9.04836" client="1.3.1-9.04836" />
Example
addCommandHandler ( "sha", -- Create a command function ( thePlayer, command, input ) if ( input ) then -- Check if the string exist local sha256hash = sha256( input ) -- Generate the hash outputChatBox( sha256hash ) -- Output the hash in the chat end end )
See Also
Shared
- 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