Skip to content

Instantly share code, notes, and snippets.

@IamLupo
IamLupo / sha256.lua
Created June 13, 2017 08:04
Lua sha256
local MOD = 2^32
local MODM = MOD-1
local function memoize(f)
local mt = {}
local t = setmetatable({}, mt)
function mt:__index(k)
local v = f(k)
t[k] = v
return v