forked from AssemblyScript/assemblyscript
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhash.optimized.wat
More file actions
63 lines (63 loc) · 1.28 KB
/
hash.optimized.wat
File metadata and controls
63 lines (63 loc) · 1.28 KB
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
(module
(type $none_=>_none (func))
(type $i32_=>_none (func (param i32)))
(memory $0 1)
(data (i32.const 1028) "\01\00\00\00\01")
(data (i32.const 1040) "\02\00\00\00\01\00\00\00\01\00\00\00\02\00\00\00a")
(data (i32.const 1072) "\04\00\00\00\01\00\00\00\01\00\00\00\04\00\00\00a\00b")
(data (i32.const 1104) "\06\00\00\00\01\00\00\00\01\00\00\00\06\00\00\00a\00b\00c")
(export "memory" (memory $0))
(start $~start)
(func $~lib/util/hash/hashStr (param $0 i32)
(local $1 i32)
(local $2 i32)
(local $3 i32)
i32.const -2128831035
local.set $2
local.get $0
if
local.get $0
i32.const 16
i32.sub
i32.load offset=12
i32.const 1
i32.shr_u
i32.const 1
i32.shl
local.set $3
loop $for-loop|0
local.get $1
local.get $3
i32.lt_u
if
local.get $2
local.get $0
local.get $1
i32.add
i32.load8_u
i32.xor
i32.const 16777619
i32.mul
local.set $2
local.get $1
i32.const 1
i32.add
local.set $1
br $for-loop|0
end
end
end
)
(func $~start
i32.const 0
call $~lib/util/hash/hashStr
i32.const 1040
call $~lib/util/hash/hashStr
i32.const 1056
call $~lib/util/hash/hashStr
i32.const 1088
call $~lib/util/hash/hashStr
i32.const 1120
call $~lib/util/hash/hashStr
)
)