optimize: switched to t/sha1_bin.tstr from string.len(str) in the Lua code. thanks Mike Pall for the suggestion.