summaryrefslogtreecommitdiff
path: root/tests/modules/hash/test.lua
blob: 06722fd9da2baf22c5bb9b0a913b0ce5563e705a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
function test_rand32(t)
    local set = {}
    for i = 1, 1000 do
        local r = hash.rand32()
        t:require(set[r] == nil)
        set[r] = r
    end
end

function test_rand64(t)
    local set = {}
    for i = 1, 100000 do
        local r = hash.rand64()
        t:require(set[r] == nil)
        set[r] = r
    end
end

function test_rand128(t)
    local set = {}
    for i = 1, 100000 do
        local r = hash.rand128()
        t:require(set[r] == nil)
        set[r] = r
    end
end