1

I'm new to Lua Scripting. Trying to use SHA256 hashing mechanism in my Lua script.

DOES Lua 5.3.5 version has SHA256 as inbuilt library like string, math, etc.. OR Do we need to install using luarocks install sha2?

I have tried luarocks install sha2 in my MAC but getting error listed below,

sha2lib.c:133:27: error: array has incomplete element type 'struct luaL_reg'
static struct luaL_reg reg[] = {

Error: Build error: Failed compiling object sha2lib.o

Egor Skriptunoff
  • 906
  • 1
  • 8
  • 23
erdarun
  • 441
  • 1
  • 8
  • 14

1 Answers1

3

Lua does not have a builtin SHA256 library.

See https://github.com/Egor-Skriptunoff/pure_lua_SHA2 for a pure Lua solution.

lhf
  • 70,581
  • 9
  • 108
  • 149