Sha1.lua
(Deprecated Repo) SHA-1 secure hash computation, and HMAC-SHA1 signature computation in Lua (5.1)
Install / Use
/learn @kikito/Sha1.luaREADME
Deprecated Repo
I have stopped development on this library due to lack of interest and time.
Peter Melnichenko has graciously taken over development. His work can be seen on here:
- https://github.com/mpeterv/sha1
I have also transfered my Luarocks rights for sha1 to him, and he'll be the one publishing them
from now on.
This repo will remain on github for historical purposes.
sha1.lua
This pure-Lua module computes SHA-1 and HMAC-SHA1 signature computations in Lua 5.1.
Usage
local sha1 = require 'sha1'
local hash_as_hex = sha1(message) -- returns a hex string
local hash_as_data = sha1.binary(message) -- returns raw bytes
local hmac_as_hex = sha1.hmac(key, message) -- hex string
local hmac_as_data = sha1.hmac_binary(key, message) -- raw bytes
Credits
This is a cleanup of an implementation by Eike Decker - http://cube3d.de/uploads/Main/sha1.txt,
Which in turn was based on an original implementation by Jeffrey Friedl - http://regex.info/blog/lua/sha1
The original algorithm is http://www.itl.nist.gov/fipspubs/fip180-1.htm
License
This version, as well as all the previous ones in which is based, are implemented under the MIT license (See license file for details).
Specs
The specs for this library are implemented with busted. In order to run them, install busted and then:
cd path/to/where/the/spec/folder/is
busted
Related Skills
node-connect
331.2kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
81.5kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
331.2kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
commit-push-pr
81.5kCommit, push, and open a PR
