Jeffrey Friedl’s Blog » SHA-1 and HMAC-SHA1 Routines in Pure Lua
http://regex.info/blog/lua/sha1
"I've coded up SHA-1 Secure Hash computation and HMAC-SHA1 secure signature computation in pure Lua and thought I'd share them in case anyone else would find them useful."