on 883cb21 help sign in
820 lines 17 kB history raw
1+++
2title = "3d: SHA Hash Family"
3weight = 24
4template = "doc.html"
5+++
7## `++shad`
9Double SHA-256
11Produces an atom that is twice-hashed with `shax`, the SHA-256 cryptographic
12hash algorithm.
14#### Accepts
16`ruz` is an atom.
18#### Produces
20An atom.
22#### Source
24```hoon
25++ shad |=(ruz=@ (shax (shax ruz)))
26```
28#### Examples
30```
31> `@uw`(shad 11)
320w2Rt.J1gzO.JjsQc.0Komy.DYUUO.27koh.QxwE0.Qgwt7.EPGCi
33```
35---
37## `++shaf`
39Half SHA-256
41Produces a 128-bit atom by performing the [bitwise
42XOR](/docs/hoon/reference/stdlib/2d) on the first and last halves of the 256-bit
43salted hash `shas`.
45#### Accepts
47`sal` is an atom.
49`ruz` is an atom.
51#### Source
53```hoon
54++ shaf
55 |= [sal=@ ruz=@]
56 =+ haz=(shas sal ruz)
57 (mix (end 7 haz) (rsh 7 haz))
58```
60#### Examples
62```
63> `@uw`(shaf 17 8)
640wD.DSP0L.WUuQg.-A765.4RY-h
65```
67---
69## `++sham`
71128-bit noun hash
73Produces a 128-bit atom by hashing a noun `yux` with the [`+shaf`](#shaf)
74function. If that noun is a cell, then it is passed to the
75[`jam`](/docs/hoon/reference/stdlib/2p#jam) function to produce an atom to be
76hashed.
78#### Accepts
80`yux` is a noun.
82#### Produces
84A `@uvH`.
86#### Source
88```hoon
89++ sham
90 |= yux=* ^- @uvH ^- @
91 ?@ yux
92 (shaf %mash yux)
93 (shaf %sham (jam yux))
94```
96#### Examples
98```
99> (sham [2 4])
1000v3.71s52.4bqnp.ki2b8.9hhsp.2ufgg
102> (sham "hello")
1030v1.hg8mv.t7s3f.u4f8a.q5noe.dvqvh
104```
106---
108## `++shas`
110Salted hash
112Produces an atom by using SHA-256 plus a salt input. The [bitwise
113XOR](/docs/hoon/reference/stdlib/2d) is performed on salt `sal` and the product
114of atom `ruz` hashed with SHA-256. The product of that logical operation is then
115itself hashed with SHA-256.
117#### Accepts
119`sal` is an atom.
121`ruz` is an atom.
123#### Source
125```hoon
126++ shas
127 ~/ %shas
128 |= [sal=@ ruz=@]
129 (shax (mix sal (shax ruz)))
130```
132#### Examples
134```
135> `@uw`(shas 1 1)
1360w5hZ.Gim4L.9xKlU.jJJQr.2Bgi~.RHd5s.IwXuV.p43at.ZdsTY
137```
139---
141## `++shax`
143SHA-256
145Produces an atom by hashing an atom `ruz` with SHA-256.
147#### Sources
149```hoon
150++ shax
151 ~/ %shax
152 |= ruz=@ ^- @
153 (shay [(met 3 ruz) ruz])
154```
156#### Examples
158```
159> `@uw`(shax 'foo')
1600waXD.pCa8n.EHVEb.-3p70.JgxcQ.gj0tf.4mr-o.~6~Sx.HJ2oI
161```
163---
165## `++shay`
167SHA-256 with length
169Produces an atom by hashing an atom `ruz` with SHA-512. Another atom, `len`, is
170the byte-length of the theoretical buffer represented by the atom.
172#### Accepts
174`len` is an atom.
176`ruz` is an atom.
178#### Source
180```hoon
181++ shay
182 ~/ %shay
183 |= [len=@u ruz=@] ^- @
184 => .(ruz (cut 3 [0 len] ruz))
185 =+ [few==>(fe .(a 5)) wac=|=([a=@ b=@] (cut 5 [a 1] b))]
186 =+ [sum=sum.few ror=ror.few net=net.few inv=inv.few]
187 =+ ral=(lsh [0 3] len)
188 =+ ^= ful
189 %+ can 0
190 :~ [ral ruz]
191 [8 128]
192 [(mod (sub 960 (mod (add 8 ral) 512)) 512) 0]
193 [64 (~(net fe 6) ral)]
194 ==
195 =+ lex=(met 9 ful)
196 =+ ^= kbx 0xc671.78f2.bef9.a3f7.a450.6ceb.90be.fffa.
197 8cc7.0208.84c8.7814.78a5.636f.748f.82ee.
198 682e.6ff3.5b9c.ca4f.4ed8.aa4a.391c.0cb3.
199 34b0.bcb5.2748.774c.1e37.6c08.19a4.c116.
200 106a.a070.f40e.3585.d699.0624.d192.e819.
201 c76c.51a3.c24b.8b70.a81a.664b.a2bf.e8a1.
202 9272.2c85.81c2.c92e.766a.0abb.650a.7354.
203 5338.0d13.4d2c.6dfc.2e1b.2138.27b7.0a85.
204 1429.2967.06ca.6351.d5a7.9147.c6e0.0bf3.
205 bf59.7fc7.b003.27c8.a831.c66d.983e.5152.
206 76f9.88da.5cb0.a9dc.4a74.84aa.2de9.2c6f.
207 240c.a1cc.0fc1.9dc6.efbe.4786.e49b.69c1.
208 c19b.f174.9bdc.06a7.80de.b1fe.72be.5d74.
209 550c.7dc3.2431.85be.1283.5b01.d807.aa98.
210 ab1c.5ed5.923f.82a4.59f1.11f1.3956.c25b.
211 e9b5.dba5.b5c0.fbcf.7137.4491.428a.2f98
212 =+ ^= hax 0x5be0.cd19.1f83.d9ab.9b05.688c.510e.527f.
213 a54f.f53a.3c6e.f372.bb67.ae85.6a09.e667
214 =+ i=0
215 |- ^- @
216 ?: =(i lex)
217 (run 5 hax net)
218 =+ ^= wox
219 =+ dux=(cut 9 [i 1] ful)
220 =+ wox=(run 5 dux net)
221 =+ j=16
222 |- ^- @
223 ?: =(64 j)
224 wox
225 =+ :* l=(wac (sub j 15) wox)
226 m=(wac (sub j 2) wox)
227 n=(wac (sub j 16) wox)
228 o=(wac (sub j 7) wox)
229 ==
230 =+ x=:(mix (ror 0 7 l) (ror 0 18 l) (rsh [0 3] l))
231 =+ y=:(mix (ror 0 17 m) (ror 0 19 m) (rsh [0 10] m))
232 =+ z=:(sum n x o y)
233 $(wox (con (lsh [5 j] z) wox), j +(j))
234 =+ j=0
235 =+ :* a=(wac 0 hax)
236 b=(wac 1 hax)
237 c=(wac 2 hax)
238 d=(wac 3 hax)
239 e=(wac 4 hax)
240 f=(wac 5 hax)
241 g=(wac 6 hax)
242 h=(wac 7 hax)
243 ==
244 |- ^- @
245 ?: =(64 j)
246 %= ^$
247 i +(i)
248 hax %+ rep 5
249 :~ (sum a (wac 0 hax))
250 (sum b (wac 1 hax))
251 (sum c (wac 2 hax))
252 (sum d (wac 3 hax))
253 (sum e (wac 4 hax))
254 (sum f (wac 5 hax))
255 (sum g (wac 6 hax))
256 (sum h (wac 7 hax))
257 ==
258 ==
259 =+ l=:(mix (ror 0 2 a) (ror 0 13 a) (ror 0 22 a)) :: s0
260 =+ m=:(mix (dis a b) (dis a c) (dis b c)) :: maj
261 =+ n=(sum l m) :: t2
262 =+ o=:(mix (ror 0 6 e) (ror 0 11 e) (ror 0 25 e)) :: s1
263 =+ p=(mix (dis e f) (dis (inv e) g)) :: ch
264 =+ q=:(sum h o p (wac j kbx) (wac j wox)) :: t1
265 $(j +(j), a (sum q n), b a, c b, d c, e (sum d q), f e, g f, h g)
266```
268#### Examples
270```
271> `@uw`(shay 1 'hello')
2720w2eN.jupNe.OyGTU.-l0Co.SWSGS.fFD9k.HPHg1.-AYmg.CgaCG
273```
275```
276> `@uw`(shay 2 'hello')
2770wdUu.vKccX.fhjYt.tY2a4.B~sqA.KWNOM.1TnEu.8sQd8.LvyYT
278```
280#### Discussion
282Because byte-strings can have leading zeros, but atoms cannot, we use `len`
283as a way of saying that the atom `ruz` is shorter than its representative
284byte-string.
286---
288## `++shaw`
290Hash to nbits
292Produces an atom of `len` random bits by hashing `ruz` with the salted
293SHA-256 hash algorithm, where `sal` is the cryptographic salt.
295#### Accepts
297`sal` is an atom.
299`len` is an atom.
301`ruz` is an atom.
303#### Produces
305An atom.
307#### Source
309```hoon
310++ shaw
311 |= [sal=@ len=@ ruz=@]
312 (~(raw og (shas sal (mix len ruz))) len)
313```
315#### Examples
317```
318> `@ub`(shaw 3 6 98)
3190b11.0111
321> `@ub`(shaw 2 6 98)
3220b11
323```
325---
327## `++shaz`
329SHA-512
331Produces an atom by hashing an atom `ruz` with SHA-512.
333#### Accepts
335`ruz` is an atom.
337#### Produces
339An atom.
341#### Source
343```hoon
344++ shaz
345 |= ruz=@ ^- @
346 (shal [(met 3 ruz) ruz])
347```
349#### Examples
351```
352`@uw`(shaz 'hello')
3530w1.3MdWY.sS~QT.zFsbB.N7oQo.cSImU.56Xcu.DMtMq.mrSsc.z8WsY.pNABZ.Z~ySG.Ecysb.XCP5P.fuHjq.Jimnn.zPoHQ.AQD6r
354```
356---
358## `++shal`
360SHA-512 with length
362Produces an atom by hashing an atom `ruz` with SHA-512. Another atom, `len`, is
363the byte-length of the theoretical buffer represented by the atom.
365#### Accepts
367`len` is an atom.
369`ruz` is an atom.
371#### Produces
373An atom.
375#### Source
377```hoon
378++ shal
379 ~/ %shal
380 |= [len=@ ruz=@] ^- @
381 => .(ruz (cut 3 [0 len] ruz))
382 =+ [few==>(fe .(a 6)) wac=|=([a=@ b=@] (cut 6 [a 1] b))]
383 =+ [sum=sum.few ror=ror.few net=net.few inv=inv.few]
384 =+ ral=(lsh [0 3] len)
385 =+ ^= ful
386 %+ can 0
387 :~ [ral ruz]
388 [8 128]
389 [(mod (sub 1.920 (mod (add 8 ral) 1.024)) 1.024) 0]
390 [128 (~(net fe 7) ral)]
391 ==
392 =+ lex=(met 10 ful)
393 =+ ^= kbx 0x6c44.198c.4a47.5817.5fcb.6fab.3ad6.faec.
394 597f.299c.fc65.7e2a.4cc5.d4be.cb3e.42b6.
395 431d.67c4.9c10.0d4c.3c9e.be0a.15c9.bebc.
396 32ca.ab7b.40c7.2493.28db.77f5.2304.7d84.
397 1b71.0b35.131c.471b.113f.9804.bef9.0dae.
398 0a63.7dc5.a2c8.98a6.06f0.67aa.7217.6fba.
399 f57d.4f7f.ee6e.d178.eada.7dd6.cde0.eb1e.
400 d186.b8c7.21c0.c207.ca27.3ece.ea26.619c.
401 c671.78f2.e372.532b.bef9.a3f7.b2c6.7915.
402 a450.6ceb.de82.bde9.90be.fffa.2363.1e28.
403 8cc7.0208.1a64.39ec.84c8.7814.a1f0.ab72.
404 78a5.636f.4317.2f60.748f.82ee.5def.b2fc.
405 682e.6ff3.d6b2.b8a3.5b9c.ca4f.7763.e373.
406 4ed8.aa4a.e341.8acb.391c.0cb3.c5c9.5a63.
407 34b0.bcb5.e19b.48a8.2748.774c.df8e.eb99.
408 1e37.6c08.5141.ab53.19a4.c116.b8d2.d0c8.
409 106a.a070.32bb.d1b8.f40e.3585.5771.202a.
410 d699.0624.5565.a910.d192.e819.d6ef.5218.
411 c76c.51a3.0654.be30.c24b.8b70.d0f8.9791.
412 a81a.664b.bc42.3001.a2bf.e8a1.4cf1.0364.
413 9272.2c85.1482.353b.81c2.c92e.47ed.aee6.
414 766a.0abb.3c77.b2a8.650a.7354.8baf.63de.
415 5338.0d13.9d95.b3df.4d2c.6dfc.5ac4.2aed.
416 2e1b.2138.5c26.c926.27b7.0a85.46d2.2ffc.
417 1429.2967.0a0e.6e70.06ca.6351.e003.826f.
418 d5a7.9147.930a.a725.c6e0.0bf3.3da8.8fc2.
419 bf59.7fc7.beef.0ee4.b003.27c8.98fb.213f.
420 a831.c66d.2db4.3210.983e.5152.ee66.dfab.
421 76f9.88da.8311.53b5.5cb0.a9dc.bd41.fbd4.
422 4a74.84aa.6ea6.e483.2de9.2c6f.592b.0275.
423 240c.a1cc.77ac.9c65.0fc1.9dc6.8b8c.d5b5.
424 efbe.4786.384f.25e3.e49b.69c1.9ef1.4ad2.
425 c19b.f174.cf69.2694.9bdc.06a7.25c7.1235.
426 80de.b1fe.3b16.96b1.72be.5d74.f27b.896f.
427 550c.7dc3.d5ff.b4e2.2431.85be.4ee4.b28c.
428 1283.5b01.4570.6fbe.d807.aa98.a303.0242.
429 ab1c.5ed5.da6d.8118.923f.82a4.af19.4f9b.
430 59f1.11f1.b605.d019.3956.c25b.f348.b538.
431 e9b5.dba5.8189.dbbc.b5c0.fbcf.ec4d.3b2f.
432 7137.4491.23ef.65cd.428a.2f98.d728.ae22
433 =+ ^= hax 0x5be0.cd19.137e.2179.1f83.d9ab.fb41.bd6b.
434 9b05.688c.2b3e.6c1f.510e.527f.ade6.82d1.
435 a54f.f53a.5f1d.36f1.3c6e.f372.fe94.f82b.
436 bb67.ae85.84ca.a73b.6a09.e667.f3bc.c908
437 =+ i=0
438 |- ^- @
439 ?: =(i lex)
440 (run 6 hax net)
441 =+ ^= wox
442 =+ dux=(cut 10 [i 1] ful)
443 =+ wox=(run 6 dux net)
444 =+ j=16
445 |- ^- @
446 ?: =(80 j)
447 wox
448 =+ :* l=(wac (sub j 15) wox)
449 m=(wac (sub j 2) wox)
450 n=(wac (sub j 16) wox)
451 o=(wac (sub j 7) wox)
452 ==
453 =+ x=:(mix (ror 0 1 l) (ror 0 8 l) (rsh [0 7] l))
454 =+ y=:(mix (ror 0 19 m) (ror 0 61 m) (rsh [0 6] m))
455 =+ z=:(sum n x o y)
456 $(wox (con (lsh [6 j] z) wox), j +(j))
457 =+ j=0
458 =+ :* a=(wac 0 hax)
459 b=(wac 1 hax)
460 c=(wac 2 hax)
461 d=(wac 3 hax)
462 e=(wac 4 hax)
463 f=(wac 5 hax)
464 g=(wac 6 hax)
465 h=(wac 7 hax)
466 ==
467 |- ^- @
468 ?: =(80 j)
469 %= ^$
470 i +(i)
471 hax %+ rep 6
472 :~ (sum a (wac 0 hax))
473 (sum b (wac 1 hax))
474 (sum c (wac 2 hax))
475 (sum d (wac 3 hax))
476 (sum e (wac 4 hax))
477 (sum f (wac 5 hax))
478 (sum g (wac 6 hax))
479 (sum h (wac 7 hax))
480 ==
481 ==
482 =+ l=:(mix (ror 0 28 a) (ror 0 34 a) (ror 0 39 a)) :: S0
483 =+ m=:(mix (dis a b) (dis a c) (dis b c)) :: maj
484 =+ n=(sum l m) :: t2
485 =+ o=:(mix (ror 0 14 e) (ror 0 18 e) (ror 0 41 e)) :: S1
486 =+ p=(mix (dis e f) (dis (inv e) g)) :: ch
487 =+ q=:(sum h o p (wac j kbx) (wac j wox)) :: t1
488 $(j +(j), a (sum q n), b a, c b, d c, e (sum d q), f e, g f, h g)
489```
491#### Examples
493```
494> `@uw`(shal 1 'hello')
4950w2.nWO0R.zMAzH.OSWU1.apOje.19Mta.RE24o.4u~MB.wQuj4.NDdG6.0QZA0.w21Br.yQVhu.pFBII.Cdgvd.WT-bH.g51Yu.fL44y
496```
498```
499> `@uw`(shal 2 'hello')
5000w1.r3W4g.hae37.8YUFp.ntryr.DsQuY.rPsdm.p3Xjv.rayLz.DslEc.Lxvll.OJUc3.tZeLZ.TjUnu.XMyGr.82qPA.zl1y0.HbSpT
501```
503#### Discussion
505Because byte-strings can have leading zeros, but atoms cannot, we use `len`
506as a way of saying that the atom `ruz` is shorter than its representative
507byte-string.
509---
511## `++shan`
513SHA-1
515Produces an atom by hashing an atom `ruz` with SHA-1.
517#### Accepts
519`ruz` is an atom.
521#### Produces
523An atom.
525#### Source
527```hoon
528++ shan
529 |= ruz=@
530 =+ [few==>(fe .(a 5)) wac=|=([a=@ b=@] (cut 5 [a 1] b))]
531 =+ [sum=sum.few ror=ror.few rol=rol.few net=net.few inv=inv.few]
532 =+ ral=(lsh [0 3] (met 3 ruz))
533 =+ ^= ful
534 %+ can 0
535 :~ [ral ruz]
536 [8 128]
537 [(mod (sub 960 (mod (add 8 ral) 512)) 512) 0]
538 [64 (~(net fe 6) ral)]
539 ==
540 =+ lex=(met 9 ful)
541 =+ kbx=0xca62.c1d6.8f1b.bcdc.6ed9.eba1.5a82.7999
542 =+ hax=0xc3d2.e1f0.1032.5476.98ba.dcfe.efcd.ab89.6745.2301
543 =+ i=0
544 |-
545 ?: =(i lex)
546 (rep 5 (flop (rip 5 hax)))
547 =+ ^= wox
548 =+ dux=(cut 9 [i 1] ful)
549 =+ wox=(rep 5 (turn (rip 5 dux) net))
550 =+ j=16
551 |- ^- @
552 ?: =(80 j)
553 wox
554 =+ :* l=(wac (sub j 3) wox)
555 m=(wac (sub j 8) wox)
556 n=(wac (sub j 14) wox)
557 o=(wac (sub j 16) wox)
558 ==
559 =+ z=(rol 0 1 :(mix l m n o))
560 $(wox (con (lsh [5 j] z) wox), j +(j))
561 =+ j=0
562 =+ :* a=(wac 0 hax)
563 b=(wac 1 hax)
564 c=(wac 2 hax)
565 d=(wac 3 hax)
566 e=(wac 4 hax)
567 ==
568 |- ^- @
569 ?: =(80 j)
570 %= ^$
571 i +(i)
572 hax %+ rep 5
573 :~
574 (sum a (wac 0 hax))
575 (sum b (wac 1 hax))
576 (sum c (wac 2 hax))
577 (sum d (wac 3 hax))
578 (sum e (wac 4 hax))
579 ==
580 ==
581 =+ fx=(con (dis b c) (dis (not 5 1 b) d))
582 =+ fy=:(mix b c d)
583 =+ fz=:(con (dis b c) (dis b d) (dis c d))
584 =+ ^= tem
585 ?: &((gte j 0) (lte j 19))
586 :(sum (rol 0 5 a) fx e (wac 0 kbx) (wac j wox))
587 ?: &((gte j 20) (lte j 39))
588 :(sum (rol 0 5 a) fy e (wac 1 kbx) (wac j wox))
589 ?: &((gte j 40) (lte j 59))
590 :(sum (rol 0 5 a) fz e (wac 2 kbx) (wac j wox))
591 :(sum (rol 0 5 a) fy e (wac 3 kbx) (wac j wox))
592 $(j +(j), a tem, b a, c (rol 0 30 b), d c, e d)
593```
595#### Examples
597```
598> `@uw`(shan 'hello')
5990waH.QNxTs.NuyyS.HXu3P.J8bdC.KGkdd
600```
602#### Discussion
604SHA-1 is a deprecated function; it is not considered secure.
606---
608## `++og`
610Container arm for SHA-256-powered random-number generation. Its sample `a` is an
611atom that is used as a seed for the hash.
613#### Accepts
615`a` is an atom.
617#### Produces
619A core.
621#### Source
623```hoon
624++ og
625 ~/ %og
626 |_ a=@
627```
629#### Examples
631```
632> ~(. og 919)
633<4.wmp {a/@ud <54.tyv 119.olq 31.ohr 1.jmk $143>}>
634```
636#### Discussion
638Note that the product is deterministic; the seed will produce the same
639result every time it is run. Use `eny`, 256 bits of entropy, for a
640non-deterministic product.
642---
644### `++rad:og`
646Random in range
648Produces a random number that is within the range of first `b` whole numbers,
649starting at `0`.
651#### Accepts
653`b` is an atom.
655#### Produces
657An atom.
659#### Source
661```hoon
662++ rad
663 |= b=@ ^- @
664 ~_ leaf+"rad-zero"
665 ?< =(0 b)
666 =+ c=(raw (met 0 b))
667 ?:((lth c b) c $(a +(a)))
668```
670#### Examples
672```
673> (~(rad og 5) 11)
676> (~(rad og 758.716.593) 11)
679> (~(rad og 1) 100.000)
68071.499
682> (~(rad og eny) 11) :: `eny` acts as a random sample
684```
686---
688### `++rads:og`
690Random continuation
692Produces a cell. The head of the cell is a random number that is within the
693range of first `b` whole numbers, starting at `0`. The tail is a new core
694produced from hashing the parent core with `(rad b)`.
696#### Accepts
698`b` is an atom.
700#### Produces
702A cell.
704#### Source
706```hoon
707++ rads
708 |= b=@
709 =+ r=(rad b)
710 [r +>.$(a (shas %og-s (mix a r)))]
711```
713#### Examples
715```
716> (~(rads og 4) 10)
717[2 <4.wmp {a/@ <54.tyv 119.olq 31.ohr 1.jmk $143>}>]
719> =/ rng ~(. og 7)
720 =^ a rng (rads:rng 10)
721 =^ b rng (rads:rng 10)
722 [a b]
723[2 8]
724```
726#### Discussion
728Since everything in Hoon is a pure function, we need to use tricks like this to
729generate separate random values from the same seed. Notice how we jump from
730one `rads` function call to another in the above example.
732---
734### `++raw:og`
736Random bits
738Produces an atom with a bitwidth `b` that is composed of random bits.
740#### Accepts
742`b` is an atom.
744#### Produces
746An atom.
748#### Source
750```hoon
751++ raw
752 ~/ %raw
753 |= b=@ ^- @
754 %+ can
755 0
756 =+ c=(shas %og-a (mix b a))
757 |- ^- (list [@ @])
758 ?: =(0 b)
759 ~
760 =+ d=(shas %og-b (mix b (mix a c)))
761 ?: (lth b 256)
762 [[b (end [0 b] d)] ~]
763 [[256 d] $(c d, b (sub b 256))]
764```
766#### Examples
768```
769> `@ud`(~(raw og 27) 4)
7700b1001
772> `@ub`(~(raw og 27) 3)
7730b0
775> `@ub`(~(raw og 11) 4)
7760b1111
778> `@ub`(~(raw og 11) 3)
7790b100
780```
782---
784### `++raws:og`
786Random bits continuation
788Produces a cell. The head of the cell is an atom with a bitwidth `b` that is
789composed of random bits. The tail is a new core produced from hashing the
790parent core with `(raw b)`.
792#### Source
794```hoon
795++ raws
796 |= b=@
797 =+ r=(raw b)
798 [r +>.$(a (shas %og-s (mix a r)))]
799```
801#### Examples
803```
804> `[@ub _og]`(~(raws og 7) 4)
805[0b1100 <4.wmp {a/@ <54.tyv 119.olq 31.ohr 1.jmk $143>}>]
807> =/ rng ~(. og 7)
808 =^ a rng (rads:rng 4)
809 =^ b rng (rads:rng 4)
810 [`@ub`a `@ub`b]
811[0b10 0b1]
812```
814#### Discussion
816Since everything in Hoon is a pure function, we need to use tricks like this to
817generate separate random values from the same seed. Notice how we jump from
818one `raws` function call to another in the above example.
820---