-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.lua
More file actions
19 lines (17 loc) · 688 Bytes
/
test.lua
File metadata and controls
19 lines (17 loc) · 688 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
local xxh64 = require("xxh64")
local xxh32 = require("xxh32")
local function ps(i)
print(string.format("%x", i))
end
print(":: xxh64\n")
os.execute("printf qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM | xxh64sum")
ps(xxh64.sum("qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM"))
local s = xxh64.state(0)
--s:update()
ps(s:digest("qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM"))
print("\n:: xxh32\n")
os.execute("printf qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM | xxh32sum")
ps(xxh32.sum("qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM"))
local s2 = xxh32.state(0)
--s:update()
ps(s2:digest("qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM"))