@@ -43,9 +43,9 @@ An atom.
44### `++mug`
44### `++mug`
46−FNV-1a scrambler
46+murmur3 scrambler
48−Hashes `a` with the 31-bit nonzero FNV-1a non-cryptographic hash algorithm,
48+Hashes `a` with the 31-bit murmur3 non-cryptographic hash algorithm,
49producing an atom.
49producing an atom.
51#### Accepts
51#### Accepts
@@ -59,45 +59,37 @@ An atom.
59#### Source
59#### Source
62− ++ mug
62+++ mug :: mug with murmur3
65− ?^ a
65+ |^ (trim ?@(a a (mix $(a -.a) (mix 0x7fff.ffff $(a +.a)))))
66− =+ b=[p=$(a -.a) q=$(a +.a)]
66+ ++ trim :: 31-bit nonzero
68− =+ c=(fnv (mix p.b (fnv q.b)))
68+ =+ syd=0xcafe.babe
69− =+ d=(mix (rsh 0 31 c) (end 0 31 c))
74− =+ c=b
70+ =+ haz=(muk syd (met 3 key) key)
78− =+ f=(mix (rsh 0 31 c) (end 0 31 c))
71+ =+ ham=(mix (rsh 0 31 haz) (end 0 31 haz))
79− ?. =(0 f) f
72+ ?.(=(0 ham) ham $(syd +(syd)))
81− $(c (fnv (mix c (cut 3 [d 1] a))), d +(d))
84#### Examples
76#### Examples
87 > (mug 10.000)
79 > (mug 10.000)
88− 178.152.889
80+ 795.713.195
90 > (mug 10.001)
82 > (mug 10.001)
91− 714.838.017
83+ 420.521.697
94− 67.918.732
86+ 1.901.865.568
96 > (mug (some 10))
88 > (mug (some 10))
97− 1.872.403.737
89+ 2.099.076.946
99 > (mug [1 2 3 4 5 ~])
91 > (mug [1 2 3 4 5 ~])
100− 1.067.931.605
92+ 1.719.833.228
@@ -273,4 +265,4 @@ An atom.