lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Sun, Oct 7, 2018 at 2:02 AM Egor Skriptunoff
<egor.skriptunoff@gmail.com> wrote:
>
> Hi!
>
> I wrote a module with SHA2 functions in pure Lua.
> The code tries to use specific benefits of your system to make calculations as fast as possible.
> For every Lua version the module contains separate implementation branch optimized for this version.
> <snip>
> -- Egor
>

Hello Egor!

This is very impressive! I've just released an optimized version of
SHA1 in pure Lua
based on work by Enrique García Cota and I will definitely have some
optimization to lift
(with appropriate credits) from this.

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. It can be found here:

https://github.com/mpeterv/sha1/blob/v0.6.0/src/sha1/pure_lua_ops.lua#L15-L82

-- Best regards,
-- Peter Melnichenko