local CRCLimit = tonumber("FFFF", 16) function CheckSum(text) local counter = 1 for i=1,string.len(text) do counter = counter + ((string.byte(string.sub(text, i, i))) * i * 17) end counter = math.mod(counter, CRCLimit) return string.format("%x", counter) end