在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):Egor-Skriptunoff/pure_lua_SHA开源软件地址(OpenSource Url):https://github.com/Egor-Skriptunoff/pure_lua_SHA开源编程语言(OpenSource Language):Lua 100.0%开源软件介绍(OpenSource Introduction):pure_lua_SHASHA-1, SHA-2, SHA-3, BLAKE2 and BLAKE3 functions written in pure Lua and optimized for speed. InstallationJust copy DescriptionThis module provides functions to calculate SHA digest. Main feature of this module: it was heavily optimized for speed. Supported hashes: MD5 - sha.md5(message)
SHA-1 - sha.sha1(message)
-- SHA2
SHA-224 - sha.sha224(message)
SHA-256 - sha.sha256(message)
SHA-384 - sha.sha384(message)
SHA-512 - sha.sha512(message)
SHA-512/224 - sha.sha512_224(message)
SHA-512/256 - sha.sha512_256(message)
-- SHA3
SHA3-224 - sha.sha3_224(message)
SHA3-256 - sha.sha3_256(message)
SHA3-384 - sha.sha3_384(message)
SHA3-512 - sha.sha3_512(message)
SHAKE128 - sha.shake128(digest_size_in_bytes, message)
SHAKE256 - sha.shake256(digest_size_in_bytes, message)
-- HMAC (applicable to any hash function mentioned above except SHAKE)
HMAC - sha.hmac(sha.any_hash_func, key, message)
-- BLAKE2
BLAKE2b - sha.blake2b(message, key, salt, digest_size_in_bytes)
BLAKE2s - sha.blake2s(message, key, salt, digest_size_in_bytes)
BLAKE2bp - sha.blake2bp(message, key, salt, digest_size_in_bytes)
BLAKE2sp - sha.blake2sp(message, key, salt, digest_size_in_bytes) -- BLAKE2sp is used in WinRAR and 7-Zip
BLAKE2Xb - sha.blake2xb(digest_size_in_bytes, message, key, salt)
BLAKE2Xs - sha.blake2xs(digest_size_in_bytes, message, key, salt)
-- BLAKE2b synonyms for shortened digest:
BLAKE2b-160 - sha.blake2b_160(message, key, salt) -- BLAKE2b with digest_size_in_bytes = 20
BLAKE2b-256 - sha.blake2b_256(message, key, salt) -- BLAKE2b with digest_size_in_bytes = 32
BLAKE2b-384 - sha.blake2b_384(message, key, salt) -- BLAKE2b with digest_size_in_bytes = 48
BLAKE2b-512 - sha.blake2b_512(message, key, salt) -- BLAKE2b with digest_size_in_bytes = 64 (default size)
-- BLAKE2s synonyms for shortened digest:
BLAKE2s-128 - sha.blake2s_128(message, key, salt) -- BLAKE2s with digest_size_in_bytes = 16
BLAKE2s-160 - sha.blake2s_160(message, key, salt) -- BLAKE2s with digest_size_in_bytes = 20
BLAKE2s-224 - sha.blake2s_224(message, key, salt) -- BLAKE2s with digest_size_in_bytes = 28
BLAKE2s-256 - sha.blake2s_256(message, key, salt) -- BLAKE2s with digest_size_in_bytes = 32 (default size)
-- BLAKE3
BLAKE3 - sha.blake3(message, key, digest_size_in_bytes)
BLAKE3_KDF - sha.blake3_derive_key(key_material, context_string, derived_key_size_in_bytes) UsageInput data should be provided as a binary string: either as a whole string or as a sequence of substrings ("chunk-by-chunk" loading). Simplest usage example: local sha = require("sha2")
local your_hash = sha.sha256("your string")
-- assert(your_hash == "d14d691dac70eada14d9f23ef80091bca1c75cf77cf1cd5cf2d04180ca0d9911") See file "sha2_test.lua" for more examples. FAQ |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论