Sha256: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
mNo edit summary
No edit summary
Line 4: Line 4:
{{Note box|returns an uppercase string, so make sure you string.upper() anything else you are checking against that has been sha256'd elsewhere.}}
{{Note box|returns an uppercase string, so make sure you string.upper() anything else you are checking against that has been sha256'd elsewhere.}}
{{Tip|The sha module and this function may conflict with eachother, if you use this function uninstall the module!}}
{{Tip|The sha module and this function may conflict with eachother, if you use this function uninstall the module!}}
 
{{Warning|It is strongly recommended to use passworldHash to hash passwords, md5 is easily decodable.}}


Calculates the sha256 hash of the specified string.
Calculates the sha256 hash of the specified string.

Revision as of 22:53, 19 July 2017

This template is no longer in use as it results in poor readability.

[[{{{image}}}|link=|]] Tip: The sha module and this function may conflict with eachother, if you use this function uninstall the module!
[[|link=|]] Warning: It is strongly recommended to use passworldHash to hash passwords, md5 is easily decodable.

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

This template will be deleted.

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