diff options
author | Mattes D <github@xoft.cz> | 2015-02-21 12:19:07 +0100 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2015-02-21 12:19:07 +0100 |
commit | 006b1afa9e08799ffcfc8a6285b036f711a419ea (patch) | |
tree | 405124838229912c86175d8776ff877549f1b04d /MCServer/Plugins/APIDump | |
parent | Merge pull request #1755 from mc-server/NetworkUDP (diff) | |
parent | Added cCryptoHash namespace to Lua API. (diff) | |
download | cuberite-006b1afa9e08799ffcfc8a6285b036f711a419ea.tar cuberite-006b1afa9e08799ffcfc8a6285b036f711a419ea.tar.gz cuberite-006b1afa9e08799ffcfc8a6285b036f711a419ea.tar.bz2 cuberite-006b1afa9e08799ffcfc8a6285b036f711a419ea.tar.lz cuberite-006b1afa9e08799ffcfc8a6285b036f711a419ea.tar.xz cuberite-006b1afa9e08799ffcfc8a6285b036f711a419ea.tar.zst cuberite-006b1afa9e08799ffcfc8a6285b036f711a419ea.zip |
Diffstat (limited to 'MCServer/Plugins/APIDump')
-rw-r--r-- | MCServer/Plugins/APIDump/APIDesc.lua | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/MCServer/Plugins/APIDump/APIDesc.lua b/MCServer/Plugins/APIDump/APIDesc.lua index 4c8dbd1e9..61fc69d32 100644 --- a/MCServer/Plugins/APIDump/APIDesc.lua +++ b/MCServer/Plugins/APIDump/APIDesc.lua @@ -685,6 +685,28 @@ end</pre> }, }, -- cCraftingRecipe + cCryptoHash = + { + Desc = + [[ + Provides functions for generating cryptographic hashes.</p> + <p> + Note that all functions in this class are static, so they should be called in the dot convention: +<pre class="prettyprint lang-lua"> +local Hash = cCryptoHash.sha1HexString("DataToHash") +</pre></p> + <p>Each cryptographic hash has two variants, one returns the hash as a raw binary string, the other returns the hash as a hex-encoded string twice as long as the binary string. + ]], + + Functions = + { + md5 = { Params = "Data", Return = "string", Notes = "(STATIC) Calculates the md5 hash of the data, returns it as a raw (binary) string of 16 characters." }, + md5HexString = { Params = "Data", Return = "string", Notes = "(STATIC) Calculates the md5 hash of the data, returns it as a hex-encoded string of 32 characters." }, + sha1 = { Params = "Data", Return = "string", Notes = "(STATIC) Calculates the sha1 hash of the data, returns it as a raw (binary) string of 20 characters." }, + sha1HexString = { Params = "Data", Return = "string", Notes = "(STATIC) Calculates the sha1 hash of the data, returns it as a hex-encoded string of 40 characters." }, + }, + }, -- cCryptoHash + cEnchantments = { Desc = [[ @@ -2929,7 +2951,7 @@ end StringToMobType = {Params = "string", Return = "{{Globals#MobType|MobType}}", Notes = "<b>DEPRECATED!</b> Please use cMonster:StringToMobType(). Converts a string representation to a {{Globals#MobType|MobType}} enumerated value"}, StripColorCodes = {Params = "string", Return = "string", Notes = "Removes all control codes used by MC for colors and styles"}, TrimString = {Params = "string", Return = "string", Notes = "Trims whitespace at both ends of the string"}, - md5 = {Params = "string", Return = "string", Notes = "converts a string to an md5 hash"}, + md5 = {Params = "string", Return = "string", Notes = "<b>OBSOLETE</b>, use the {{cCryptoHash}} functions instead.<br>Converts a string to a raw binary md5 hash."}, }, ConstantGroups = { |