webmcp
view libraries/moonhash/moonhash.autodoc.lua @ 552:7e874b5227b6
Bugfix in array support: info.type may be nil
| author | jbe | 
|---|---|
| date | Mon Dec 09 16:09:14 2019 +0100 (2019-12-09) | 
| parents | 83b3882dc31b | 
| children | 
 line source
     1 --[[--
     2 hash =              -- SHA3-224 digest (in hex notation) of input string
     3 moonhash.sha3_224(
     4   data              -- input string
     5 )
     7 Calculates the SHA3-224 checksum with a security of 112 bits for collision attacks and 224 bits for preimage and second preimage attacks.
     9 --]]--
    10 -- Implemented in moonhash.c and moonhash_sha3.c
    11 --//--
    14 --[[--
    15 hash =              -- SHA3-256 digest (in hex notation) of input string
    16 moonhash.sha3_256(
    17   data              -- input string
    18 )
    20 Calculates the SHA3-256 checksum with a security of 128 bits for collision attacks and 256 bits for preimage and second preimage attacks.
    22 --]]--
    23 -- Implemented in moonhash.c and moonhash_sha3.c
    24 --//--
    27 --[[--
    28 hash =              -- SHA3-384 digest (in hex notation) of input string
    29 moonhash.sha3_384(
    30   data              -- input string
    31 )
    33 Calculates the SHA3-384 checksum with a security of 192 bits for collision attacks and 384 bits for preimage and second preimage attacks.
    35 --]]--
    36 -- Implemented in moonhash.c and moonhash_sha3.c
    37 --//--
    40 --[[--
    41 hash =              -- SHA3-512 digest (in hex notation) of input string
    42 moonhash.sha3_512(
    43   data              -- input string
    44 )
    46 Calculates the SHA3-512 checksum with a security of 512 bits for collision attacks and 256 bits for preimage and second preimage attacks.
    48 --]]--
    49 -- Implemented in moonhash.c and moonhash_sha3.c
    50 --//--
    53 --[[--
    54 hash =              -- SHAKE128 digest of input string
    55 moonhash.shake128(
    56   input_data,       -- input string
    57   output_length,    -- number of characters (not bytes or bits) in output, defaults to 32
    58   output_alphabet   -- characters for encoding, defaults to "0123456789abcdef" for hex encoding
    59 )
    61 Calculates a SHAKE128 digest (FIPS 202) with a security of math.min(128, math.log(#output_alphabet, 2) * output_length/2) for collision attacks and math.min(128, math.log(#output_alphabet, 2) * output_length) for preimage and second preimage attacks. If #output_alphabet is a power of 2, a direct base-N encoding is performed. Otherwise, a base-N encoding with N equal to the next higher power of 2 is performed, and all character values smaller than or equal to #output_alphabet are discarded from the stream (the process is repeated until the hash length reaches the required output_length).
    63 --]]--
    64 -- Implemented in moonhash.c and moonhash_sha3.c
    65 --//--
    68 --[[--
    69 hash =              -- SHAKE256 digest of input string
    70 moonhash.shake256(
    71   input_data,       -- input string
    72   output_length,    -- number of characters (not bytes or bits) in output, defaults to 64
    73   output_alphabet   -- characters for encoding, defaults to "0123456789abcdef" for hex encoding
    74 )
    76 Calculates a SHAKE256 digest (FIPS 202) with a security of math.min(256, math.log(#output_alphabet, 2) * output_length/2) for collision attacks and math.min(256, math.log(#output_alphabet, 2) * output_length) for preimage and second preimage attacks. If #output_alphabet is a power of 2, a direct base-N encoding is performed. Otherwise, a base-N encoding with N equal to the next higher power of 2 is performed, and all character values smaller than or equal to #output_alphabet are discarded from the stream (the process is repeated until the hash length reaches the required output_length).
    78 --]]--
    79 -- Implemented in moonhash.c and moonhash_sha3.c
    80 --//--
