on master help sign in
2e
commite2bacd6f25e600dd8c69ab7d3007246b139fae0f authorHenry Ault <henry@tlon.io> dateWed 16 Mar 2016, 13:03 (11 years ago) parent0f63f73
6 files changed+12−20
docs/system/hoon/library/src/2e/gate/.fnv.md.swp docs/system/hoon/library/src/2e/gate/.mug.md.swp docs/system/hoon/library/src/2e/gate/.mum.md.swp docs/system/hoon/library/src/2e/gate/fnv.md+2−2 docs/system/hoon/library/src/2e/gate/mug.md+4−3 docs/system/hoon/library/src/2e/gate/mum.md+6−15
docs/system/hoon/library/src/2e/gate/.fnv.md.swpnew file

Binary file not shown.

docs/system/hoon/library/src/2e/gate/.mug.md.swpnew file

Binary file not shown.

docs/system/hoon/library/src/2e/gate/.mum.md.swpnew file

Binary file not shown.

docs/system/hoon/library/src/2e/gate/fnv.md+2−2
@@ -2,7 +2,7 @@
22
33Hashes an atom with the 32-bit FNV non-cryptographic hash algorithm.
44Multiplies `a` by the prime number 16,777,619 and then takes the block
5−of size 5 off the product's end, producing an [atom]().
5+of size 5 off the product's end, producing an atom.
66
77Accepts
88-------
@@ -18,7 +18,7 @@ An atom.
1818Source
1919------
2020
21− ++ fnv |=(a=@ (end 5 1 (mul 16.777.619 a))) :: FNV scrambler
21+ ++ fnv |=(a/@ (end 5 1 (mul 16.777.619 a))) :: FNV scrambler
2222
2323Examples
2424--------
docs/system/hoon/library/src/2e/gate/mug.md+4−3
@@ -1,12 +1,12 @@
11### `++mug`
22
33Hashes `a` with the 31-bit nonzero FNV-1a non-cryptographic hash
4−algorithm, producing an [atom]().
4+algorithm, producing an atom.
55
66Accepts
77-------
88
9−A is a [noun]().
9+A is a noun.
1010
1111Produces
1212--------
@@ -18,7 +18,7 @@ Source
1818
1919 ++ mug :: 31bit nonzero FNV1a
2020 ~/ %mug
21− |= a=*
21+ |= a/*
2222 ?^ a
2323 =+ b=[p=$(a -.a) q=$(a +.a)]
2424 |- ^- @
@@ -37,6 +37,7 @@ Source
3737 ^$(b +(b))
3838 $(c (fnv (mix c (cut 3 [d 1] a))), d +(d))
3939
40+
4041Examples
4142--------
4243
docs/system/hoon/library/src/2e/gate/mum.md+6−15
@@ -13,15 +13,15 @@ Source
1313
1414 ++ mum :: mug with murmur3
1515 ~/ %mum
16− |= a=*
16+ |= a/*
1717 |^ (trim ?@(a a (mix $(a -.a) (mix 0x7fff.ffff $(a +.a)))))
1818 ++ spec :: standard murmur3
19− |= [syd=@ key=@]
19+ |= {syd/@ key/@}
2020 ?> (lte (met 5 syd) 1)
2121 =+ ^= row
22− |= [a=@ b=@]
22+ |= {a/@ b/@}
2323 (con (end 5 1 (lsh 0 a b)) (rsh 0 (sub 32 a) b))
24− =+ mow=|=([a=@ b=@] (end 5 1 (mul a b)))
24+ =+ mow=|=({a/@ b/@} (end 5 1 (mul a b)))
2525 =+ len=(met 5 key)
2626 =- =. goc (mix goc len)
2727 =. goc (mix goc (rsh 4 1 goc))
@@ -35,22 +35,13 @@ Source
3535 ?: =(inx len) goc
3636 =+ kop=(cut 5 [inx 1] key)
3737 =. kop (mow kop 0xcc9e.2d51)
38− =. kop (row 15 kop)
38+ =. kop (row 15 kop)
3939 =. kop (mow kop 0x1b87.3593)
4040 =. goc (mix kop goc)
4141 =. goc (row 13 goc)
4242 =. goc (end 5 1 (add 0xe654.6b64 (mul 5 goc)))
4343 $(inx +(inx))
44− ::
45− ++ trim :: 31-bit nonzero
46− |= key=@
47− =+ syd=0xcafe.babe
48− |- ^- @
49− =+ haz=(spec syd key)
50− =+ ham=(mix (rsh 0 31 haz) (end 0 31 haz))
51− ?.(=(0 ham) ham $(syd +(syd)))
52− --
53− ::
44+
5445
5546Examples
5647--------