On Sun, Oct 7, 2018 at 7:57 PM Peter Melnichenko wrote:
I've just released an optimized version of
SHA1 in pure Lua
Your project is very similar to mine. :-)
For Lua 5.1 I've added an optimized way to build look-up tables for
8bit operators.
Previous version of SHA1 used a lot of time to build these when the
module was required.
In the case of your module start up is already fast (0.05 seconds on
my machine vs
0.02 with the version from SHA1) so it's not that important, but
perhaps this way
to build the look-up table is at least interesting.
Yes, the way you're constructing the look-up table is really interesting (and is faster than my look-up table constructor).
Thanks for pointing it out.
I've updated my repo to make the module load faster on Lua 5.1.