on b00decd help sign in
1656 lines 24 kB history raw
1+++
2title = "4j: Parsing (Bases and Base Digits)"
3weight = 37
4template = "doc.html"
5+++
7### `++ab`
9Primitive parser engine
11A core containing numeric parser primitives.
13#### Source
15```hoon
16 ++ ab
17 |%
18```
20#### Examples
22```
23 > ab
24 <36.ecc 414.gly 100.xkc 1.ypj %164>
25```
27------------------------------------------------------------------------
29### `++bix:ab`
31Parse hex pair
33Parsing `++rule`. Parses a pair of base-16 digits. Used in escapes.
35#### Accepts
37XX
39#### Produces
41A an atom. XX
43#### Source
45```hoon
46 ++ bix (bass 16 (stun [2 2] six))
47```
49#### Examples
51```
52 > (scan "07" bix:ab)
53 q=7
54 > (scan "51" bix:ab)
55 q=81
56 > (scan "a3" bix:ab)
57 q=163
58```
60------------------------------------------------------------------------
62### `++hif:ab`
64Parse phonetic pair
66Parsing `++rule`. Parses an atom of aura `@pE`, a phrase of two bytes
67encoded phonetically.
69#### Accepts
71XX
73#### Produces
75An atom.
77#### Source
79```hoon
80 ++ hif (boss 256 ;~(plug tip tiq (easy ~)))
81```
83#### Examples
85```
86 > (scan "doznec" hif:ab)
87 q=256
88 > (scan "pittyp" hif:ab)
89 q=48.626
90```
92------------------------------------------------------------------------
94### `++huf:ab`
96Parse two phonetic pairs
98Parsing `++rule`. Parses and unscrambles an atom of aura @pF, a phrase
99of two two-byte pairs that are encoded (and scrambled) phonetically.
101#### Accepts
103XX
105#### Produces
107An atom. XX
109#### Source
111```hoon
112 ++ huf %+ cook
113 |=([a/@ b/@] (wred:un ~(zug mu ~(zag mu [a b]))))
114 ;~(plug hif ;~(pfix hep hif))
115```
117#### Examples
119```
120 > (scan "pittyp-pittyp" huf:ab)
121 328.203.557
122 > (scan "tasfyn-partyv" huf:ab)
123 65.792
124 > `@ux`(scan "tasfyn-partyv" huf:ab)
125 0x1.0100
126```
128------------------------------------------------------------------------
130### `++hyf:ab`
132Parse 8 phonetic bytes
134Parsing `++rule`. Parses an atom of aura @pG, a phrase of eight of
135phonetic bytes.
137#### Accepts
139An atom of aura `@pG`
141#### Produces
143An atom. XX
145#### Source
147```hoon
148 ++ hyf (bass 0x1.0000.0000 ;~(plug huf ;~(pfix hep huf) (easy ~)))
149```
151#### Examples
153```
154 > (scan "sondel-forsut-tillyn-nillyt" hyf:ab)
155 q=365.637.097.828.335.095
156 > `@u`~sondel-forsut-tillyn-nillyt
157 365.637.097.828.335.095
158```
160------------------------------------------------------------------------
162### `++pev:ab`
164Parse \<= 5 base-32
166Parsing `++rule`. Parses up to five base-32 digits without a leading zero.
168#### Accepts
170Up to five @uv (base 64) digits.
172#### Produces
174An atom.
176#### Source
178```hoon
179 ++ pev (bass 32 ;~(plug sev (stun [0 4] siv)))
180```
182#### Examples
184```
185 > (scan "a" pev:ab)
186 q=10
187 > (scan "290j" pev:ab)
188 q=74.771
189 > (scan "123456" pev:ab)
190 ! {1 6}
191 ! exit
192 > (scan "090j" pev:ab)
193 ~ <syntax error at [1 11]>
194```
196------------------------------------------------------------------------
198### `++pew:ab`
200Parse \<= 5 base-64
202Parsing `++rule`. Parses up to five base-64 digits without a leading zero.
204#### Accepts
206Up to five @uw (base 64) digits.
208#### Produces
212#### Source
214```hoon
215 ++ pew (bass 64 ;~(plug sew (stun [0 4] siw)))
216```
218#### Examples
220```
221 > (scan "Q" pew:ab)
222 q=52
223 > (scan "aQ~9" pew:ab)
224 q=2.838.473
225 > `@`0waQ~9
226 2.838.473
227 > (scan "123456" pew:ab)
228 ! {1 6}
229 ! exit
230 > (scan "012345" pew:ab)
231 ! {1 1}
232 ! exit
233```
235------------------------------------------------------------------------
237### `++piv:ab`
239Parse 5 base-32
241Parsing `++rule`. Parses exactly five base-32 digits.
243#### Accepts
245#### Produces
247#### Source
249```hoon
250 ++ piv (bass 32 (stun [5 5] siv))
251```
253#### Examples
255```
256 > (scan "10b3l" piv:ab)
257 q=1.059.957
258 > (scan "1" piv:ab)
259 ! {1 2}
260 ! exit
261```
263------------------------------------------------------------------------
265### `++piw:ab`
267Parse 5 base-64
269Parsing `++rule`. Parses exactly five base-64 digits.
271#### Accepts
273#### Produces
275#### Source
277```hoon
278 ++ piw (bass 64 (stun [5 5] siw))
279```
281#### Examples
283```
284 > (scan "2C-pZ" piw:ab)
285 q=43.771.517
286 > (scan "2" piv:ab)
287 ! {1 2}
288 ! exit
289```
292------------------------------------------------------------------------
294### `++qeb:ab`
296Parse \<= 4 binary
298Parsing `++rule`. Parses a binary number of up to 4 digits in length without
299a leading zero.
301#### Accepts
303#### Produces
305#### Source
307```hoon
308 ++ qeb (bass 2 ;~(plug seb (stun [0 3] sib)))
309```
311#### Examples
313```
314 > (scan "1" qeb:ab)
315 q=1
316 > (scan "101" qeb:ab)
317 q=5
318 > (scan "1111" qeb:ab)
319 q=15
320 > (scan "11111" qeb:ab)
321 ! {1 5}
322 ! exit
323 > (scan "01" qeb:ab)
324 ! {1 1}
325 ! exit
326```
328------------------------------------------------------------------------
330### `++qex:ab`
332Parse \<= 4 hex
334Parsing `++rule`. Parses a hexadecimal number of up to 4 digits in length
335without a leading zero.
337#### Accepts
339#### Produces
341#### Source
343```hoon
344 ++ qex (bass 16 ;~(plug sex (stun [0 3] hit)))
345```
347#### Examples
349```
350 > (scan "ca" qex:ab)
351 q=202
352 > (scan "18ac" qex:ab)
353 q=6.316
354 > (scan "18acc" qex:ab)
355 ! {1 5}
356 ! exit
357 > (scan "08ac" qex:ab)
358 ! {1 1}
359 ! exit
360```
362------------------------------------------------------------------------
364### `++qib:ab`
366Parse 4 binary
368Parsing `++rule`. Parses exactly four binary digits.
370#### Accepts
372#### Produces
374#### Source
376```hoon
377 ++ qib (bass 2 (stun [4 4] sib))
378```
380#### Examples
382```
383 > (scan "0001" qib:ab)
384 q=1
385 > (scan "0100" qib:ab)
386 q=4
387 > (scan "110" qib:ab)
388 ! {1 4}
389 ! exit
390```
392------------------------------------------------------------------------
394### `++qix:ab`
396Parse 4 hex
398Parsing `++rule`. Parses exactly four hexadecimal digits.
400#### Accepts
402#### Produces
404#### Source
406```hoon
407 ++ qix (bass 16 (stun [4 4] six))
408```
410#### Examples
412```
413 > (scan "0100" qix:ab)
414 q=256
415 > (scan "10ff" qix:ab)
416 q=4.351
417 > (scan "0" qix:ab)
418 ! {1 2}
419 ! exit
420```
422------------------------------------------------------------------------
424### `++seb:ab`
426Parse 1
428Parsing `++rule`. Parses the number 1.
430#### Accepts
432#### Produces
434#### Source
436```hoon
437 ++ seb (cold 1 (just '1'))
438```
440#### Examples
442```
443 > (scan "1" seb:ab)
444 1
445 > (scan "0" seb:ab)
446 ! ~zod/try/~2014.10.23..22.34.21..bfdd/:<[1 1].[1 18]>
447 ! {1 1}
448 > (scan "2" seb:ab)
449 ! ~zod/try/~2014.10.23..22.34.29..d399/:<[1 1].[1 18]>
450 ! {1 1}
451```
453------------------------------------------------------------------------
455### `++sed:ab`
457Parse decimal
459Parsing `++rule`. Parses a nonzero decimal digit.
461#### Accepts
463#### Produces
465#### Source
467```hoon
468 ++ sed (cook |=(a/@ (sub a '0')) (shim '1' '9'))
469```
471#### Examples
473```
474 > (scan "5" sed:ab)
475 5
476 > (scan "0" sed:ab)
477 ! {1 1}
478 ! exit
479```
481------------------------------------------------------------------------
483### `++sev:ab`
485Parse base-32
487Parsing `++rule`. Parses a nonzero base-32 digit
489#### Accepts
491#### Produces
493#### Source
495```hoon
496 ++ sev ;~(pose sed sov)
497```
499#### Examples
501```
502 > (scan "c" sev:ab)
503 12
504 ~zod/socialnet=> (scan "0" sev:ab)
505 ! {1 1}
506 ! exit
507```
509------------------------------------------------------------------------
511### `++sew:ab`
513Parse base-64
515Parsing `++rule`. Parses a nonzero base-64 digit
517#### Accepts
519#### Produces
521#### Source
523```hoon
524 ++ sew ;~(pose sed sow)
525```
527#### Examples
529```
530 > (scan "M" sew:ab)
531 48
532 > (scan "0" sew:ab)
533 ! {1 1}
534 ! exit
535```
537------------------------------------------------------------------------
539### `++sex:ab`
541Parse hex
543Parsing `++rule`. Parses a nonzero hexadecimal digit.
545#### Accepts
547#### Produces
549#### Source
551```hoon
552 ++ sex ;~(pose sed sox)
553```
555#### Examples
557```
558 > (scan "e" sex:ab)
559 14
560 > (scan "0" sex:ab)
561 ! {1 1}
562 ! exit
563```
565------------------------------------------------------------------------
567### `++sib:ab`
569Parse binary
571Parsing `++rule`. Parses a binary digit.
573#### Accepts
575#### Produces
577#### Source
579```hoon
580 ++ sib (cook |=(a/@ (sub a '0')) (shim '0' '1'))
581```
583#### Examples
585```
586 > (scan "1" sib:ab)
587 1
588 ~zod/socialnet=> (scan "0" sib:ab)
589 0
590```
592------------------------------------------------------------------------
594### `++sid:ab`
596Parse decimal
598Parsing `++rule`. Parses a decimal digit.
600#### Accepts
602#### Produces
604#### Source
606```hoon
607 ++ sid (cook |=(a/@ (sub a '0')) (shim '0' '9'))
608```
610#### Examples
612```
613 > (scan "5" sid:ab)
614 5
615```
617------------------------------------------------------------------------
619### `++siv:ab`
621Parse base-32
623Parsing `++rule`. Parses a base-32 digit.
625#### Accepts
627#### Produces
629#### Source
631```hoon
632 ++ siv ;~(pose sid sov)
633```
635#### Examples
637```
638 > (scan "c" siv:ab)
639 12
640```
642------------------------------------------------------------------------
644### `++siw:ab`
646Parse base-64
648Parsing `++rule`. Parses a base-64 digit.
650#### Accepts
652#### Produces
654#### Source
656```hoon
657 ++ siw ;~(pose sid sow)
658```
660#### Examples
662```
663 > (scan "M" siw:ab)
664 48
665```
667------------------------------------------------------------------------
669### `++six:ab`
671Parse hex
673Parsing `++rule`. Parses a hexadecimal digit.
675#### Accepts
677#### Produces
679#### Source
681```hoon
682 ++ six ;~(pose sid sox)
683```
685#### Examples
687```
688 > (scan "e" six:ab)
689 14
690```
692------------------------------------------------------------------------
694### `++sov:ab`
696Parse base-32
698Parsing `++rule`. Parses a base-32 letter.
700#### Accepts
702#### Produces
704#### Source
706```hoon
707 ++ sov (cook |=(a/@ (sub a 87)) (shim 'a' 'v'))
708```
710#### Examples
712```
713 > (scan "c" sov:ab)
714 12
715```
716------------------------------------------------------------------------
718### `++sow:ab`
720Parse base-64
722Parsing `++rule`. Parses a base-64 letter/symbol.
724#### Accepts
726#### Produces
728#### Source
730```hoon
731 ++ sow ;~ pose
732 (cook |=(a/@ (sub a 87)) (shim 'a' 'z'))
733 (cook |=(a/@ (sub a 29)) (shim 'A' 'Z'))
734 (cold 62 (just '-'))
735 (cold 63 (just '~'))
736 ==
737```
739#### Examples
741```
742 > (scan "M" sow:ab)
743 48
744```
746------------------------------------------------------------------------
748### `++sox:ab`
750Parse hex letter
752Parsing `++rule`. Parses a hexadecimal letter.
754#### Accepts
756#### Produces
758#### Source
760```hoon
761 ++ sox (cook |=(a/@ (sub a 87)) (shim 'a' 'f'))
762```
764#### Examples
766```
767 > (scan "e" sox:ab)
768 14
769```
771------------------------------------------------------------------------
773### `++ted:ab`
775Parse \<= 3 decimal
777Parsing `++rule`. Parses a decimal number of up to 3 digits without a
778leading zero.
780#### Accepts
782#### Produces
784#### Source
786```hoon
787 ++ ted (bass 10 ;~(plug sed (stun [0 2] sid)))
788```
790#### Examples
792```
793 > (scan "21" ted:ab)
794 q=21
795 > (scan "214" ted:ab)
796 q=214
797 > (scan "2140" ted:ab)
798 {1 4}
799 > (scan "0" ted:ab)
800 ! {1 1}
801 ! exit
802```
804------------------------------------------------------------------------
806### `++tip:ab`
808Leading phonetic byte
810Parsing `++rule`. Parses the leading phonetic byte, which represents a
811syllable.
813#### Accepts
815#### Produces
817#### Source
819```hoon
820 ++ tip (sear |=(a/@ (ins:po a)) til)
821```
823#### Examples
825```
826 > (scan "doz" tip:ab)
827 0
829 > (scan "pit" tip:ab)
830 242
831```
833------------------------------------------------------------------------
835### `++tiq:ab`
837Trailing phonetic syllable
839Parsing `++rule`. Parses the trailing phonetic byte, which represents a
840syllable.
842#### Accepts
844#### Produces
846#### Source
848```hoon
849 ++ tiq (sear |=(a/@ (ind:po a)) til)
851```
852#### Examples
854```
855 > (scan "zod" tiq:ab)
856 0
857 > (scan "nec" tiq:ab)
858 1
859```
861------------------------------------------------------------------------
863### `++tid:ab`
865Parse 3 decimal digits
867Parsing `++rule`. Parses exactly three decimal digits.
869#### Accepts
871#### Produces
873#### Source
875```hoon
876 ++ tid (bass 10 (stun [3 3] sid))
877```
879#### Examples
881```
882 > (scan "013" tid:ab)
883 q=13
884 > (scan "01" tid:ab)
885 ! {1 3}
886 ! exit
887```
889------------------------------------------------------------------------
891### `++til:ab`
893Parse 3 lowercase
895Parsing `++rule`. Parses exactly three lowercase letters.
897#### Accepts
899#### Produces
901#### Source
903```hoon
904 ++ til (boss 256 (stun [3 3] low))
905```
907#### Examples
909```
910 > (scan "mer" til:ab)
911 q=7.497.069
912 > `@t`(scan "mer" til:ab)
913 'mer'
914 > (scan "me" til:ab)
915 ! {1 3}
916 ! exit
917```
919------------------------------------------------------------------------
921### `++urs:ab`
923Parse span characters
925Parsing rule. Parses characters from an atom of the span aura `@ta`.
927#### Accepts
929#### Produces
931#### Source
933```hoon
934 ++ urs %+ cook
935 |=(a/tape (rap 3 ^-((list @) a)))
936 (star ;~(pose nud low hep dot sig cab))
937```
939#### Examples
941```
942 > `@ta`(scan "asa-lom_tak" urs:ab)
943 ~.asa-lom_tak
944 > `@t`(scan "asa-lom_tak" urs:ab)
945 'asa-lom_tak'
946```
948------------------------------------------------------------------------
950### `++urt:ab`
952Parse non-`_` span
954Parsing rule. Parses all characters of the span aura `@ta` except
955for cab, `_`.
957#### Accepts
959#### Produces
961#### Source
963```hoon
964 ++ urt %+ cook
965 |=(a/tape (rap 3 ^-((list @) a)))
966 (star ;~(pose nud low hep dot sig))
967```
969#### Examples
971```
972 > `@t`(scan "asa-lom.t0k" urt:ab)
973 'asa-lom.t0k'
974```
976------------------------------------------------------------------------
978### `++voy:ab`
980Parse bas, soq, or bix
982Parsing rule. Parses an escaped backslash, single quote, or hex pair
983byte.
985#### Accepts
987#### Produces
989#### Source
991```hoon
992 ++ voy ;~(pfix bas ;~(pose bas soq bix))
993```
995#### Examples
997```
998 > (scan "\\0a" voy:ab)
999 q=10
1000 > (scan "\\'" voy:ab)
1001 q=39
1002```
1004------------------------------------------------------------------------
1006### `++ag`
1008Top-level atom parser engine
1010A core containing top-level atom parsers.
1012#### Accepts
1014#### Produces
1016#### Source
1018```hoon
1019 ++ ag
1020 |%
1021```
1023#### Examples
1025```
1026 > ag
1027 <14.vpu 414.mof 100.xkc 1.ypj %164>
1028```
1030------------------------------------------------------------------------
1032### `++ape:ag`
1034Parse 0 or rule
1036Parser modifier. Parses 0 or the sample rule `fel`.
1038#### Accepts
1040#### Produces
1042`fel` is a `rule`.
1044#### Source
1046```hoon
1047 ++ ape |*(fel/rule ;~(pose (cold 0 (just '0')) fel))
1048```
1050#### Examples
1052```
1053 > (scan "202" (star (ape:ag (cold 2 (just '2')))))
1054 ~[2 0 2]
1055```
1057------------------------------------------------------------------------
1059### `++bay:ag`
1061Parses binary number
1063Parsing rule. Parses a binary number without a leading zero.
1065#### Accepts
1067#### Produces
1069#### Source
1071```hoon
1072 ++ bay (ape (bass 16 ;~(plug qeb:ab (star ;~(pfix dog qib:ab)))))
1073```
1075#### Examples
1077```
1078 > (scan "10.0110" bay:ag)
1079 q=38
1080```
1082------------------------------------------------------------------------
1084### `++bip:ag`
1086Parse IPv6
1088Parsing rule. Parses a `@is`, an IPv6 address.
1090#### Accepts
1092#### Produces
1094#### Source
1096```hoon
1097 ++ bip =+ tod=(ape qex:ab)
1098 (bass 0x1.0000 ;~(plug tod (stun [7 7] ;~(pfix dog tod))))
1099```
1101#### Examples
1103```
1104 > (scan "0.0.ea.3e6c.0.0.0.0" bip:ag)
1105 q=283.183.420.760.121.105.516.068.864
1106 > `@is`(scan "0.0.ea.3e6c.0.0.0.0" bip:ag)
1107 .0.0.ea.3e6c.0.0.0.0
1108```
1110------------------------------------------------------------------------
1112### `++dem:ag`
1114Parse decimal with dots
1116Parsing rule. Parses a decimal number that includes dot separators.
1118#### Accepts
1120#### Produces
1122#### Source
1124```hoon
1125 ++ dem (ape (bass 1.000 ;~(plug ted:ab (star ;~(pfix dog tid:ab)))))
1126```
1128#### Examples
1130```
1131 > (scan "52" dem:ag)
1132 q=52
1133 > (scan "13.507" dem:ag)
1134 q=13.507
1135```
1137------------------------------------------------------------------------
1139### `++dim:ag`
1141Parse decimal number
1143Parsing rule. Parses a decimal number without a leading zero.
1145#### Accepts
1147#### Produces
1149#### Source
1151```hoon
1152 ++ dim (ape (bass 10 ;~(plug sed:ab (star sid:ab))))
1153```
1155#### Examples
1157```
1158 > (scan "52" dim:ag)
1159 q=52
1160 > (scan "013507" dim:ag)
1161 ! {1 2}
1162 ! exit
1163```
1165------------------------------------------------------------------------
1167### `++dum:ag`
1169Parse decimal with leading `0`
1171Parsing rule. Parses a decmial number with leading zeroes.
1173#### Accepts
1175#### Produces
1177#### Source
1179```hoon
1180 ++ dum (bass 10 (plus sid:ab))
1181```
1183#### Examples
1185```
1186 > (scan "52" dum:ag)
1187 q=52
1188 > (scan "0000052" dum:ag)
1189 q=52
1190 > (scan "13507" dim:ag)
1191 q=13.507
1192```
1194------------------------------------------------------------------------
1196### `++fed:ag`
1198Parse phonetic base
1200Parsing rule. Parses an atom of aura `@p`, the phonetic base.
1202#### Accepts
1204#### Produces
1206#### Source
1208```hoon
1209 ++ fed ;~ pose
1210 (bass 0x1.0000.0000.0000.0000 (most doh hyf:ab))
1211 huf:ab
1212 hif:ab
1213 tiq:ab
1214 ==
1215```
1217#### Examples
1219```
1220 > (scan "zod" fed:ag)
1222 > (scan "nec" fed:ag)
1224 > (scan "sondel" fed:ag)
1225 9.636
1226 > ~tillyn-nillyt
1227 ~tillyn-nillyt
1228 > (scan "tillyn-nillyt" fed:ag)
1229 3.569.565.175
1230 > (scan "tillyn-nillyt-tasfyn-partyv" fed:ag)
1231 15.331.165.687.565.582.592
1232 > (scan "tillyn-nillyt-tasfyn-partyv--novweb-talrud-talmud-sonfyr" fed:ag)
1233 282.810.089.790.159.633.869.501.053.313.363.681.181
1234```
1236------------------------------------------------------------------------
1238### `++hex:ag`
1240Parse hex
1242Parsing rule. Parses a hexadecimal number
1244#### Accepts
1246#### Produces
1248#### Source
1250```hoon
1251 ++ hex (ape (bass 0x1.0000 ;~(plug qex:ab (star ;~(pfix dog qix:ab)))))
1252```
1254#### Examples
1256```
1257 > (scan "4" hex:ag)
1258 q=4
1259 > (scan "1a" hex:ag)
1260 q=26
1261 > (scan "3.ac8d" hex:ag)
1262 q=240.781
1263 > `@ux`(scan "3.ac8d" hex:ag)
1264 0x3.ac8d
1265```
1267------------------------------------------------------------------------
1269### `++lip:ag`
1271Parse IPv4 address
1273Parsing rule. Parses an IPv4 address.
1275#### Accepts
1277#### Produces
1279#### Source
1281```hoon
1282 ++ lip =+ tod=(ape ted:ab)
1283 (bass 256 ;~(plug tod (stun [3 3] ;~(pfix dog tod))))
1284```
1286#### Examples
1288```
1289 > (scan "127.0.0.1" lip:ag)
1290 q=2.130.706.433
1291 > `@if`(scan "127.0.0.1" lip:ag)
1292 .127.0.0.1
1293 > `@if`(scan "8.8.8.8" lip:ag)
1294 .8.8.8.8
1295```
1297------------------------------------------------------------------------
1299### `++viz:ag`
1301Parse Base-32 with dots
1303Parsing rule. Parses a Base-32 number with dot separators.
1305#### Accepts
1307#### Produces
1309#### Source
1311```hoon
1312 ++ viz (ape (bass 0x200.0000 ;~(plug pev:ab (star ;~(pfix dog piv:ab)))))
1313```
1315#### Examples
1317```
1318 > (scan "e2.ol4pm" viz:ag)
1319 q=15.125.353.270
1320```
1322------------------------------------------------------------------------
1324### `++vum:ag`
1326Parse base-32 string
1328Parsing rule. Parses a raw base-32 string.
1330#### Accepts
1332#### Produces
1334#### Source
1336```hoon
1337 ++ vum (bass 32 (plus siv:ab))
1338```
1340#### Examples
1342```
1343 > (scan "e2ol4pm" vum:ag)
1344 q=15.125.353.270
1345```
1347------------------------------------------------------------------------
1349### `++wiz:ag`
1351Parse base-64
1353Parsing rule. Parses a base-64 number.
1355#### Accepts
1357#### Produces
1359#### Source
1361```hoon
1362 ++ wiz (ape (bass 0x4000.0000 ;~(plug pew:ab (star ;~(pfix dog piw:ab)))))
1363 --
1364 ::
1365```
1367#### Examples
1369```
1370 > (scan "e2O.l4Xpm" wiz:ag)
1371 q=61.764.130.813.526
1372```
1374---
1375### `++mu`
1377Core used to scramble 16-bit atoms
1379A door that contains arms that are used to scramble two atoms, `top`
1380and `bot`. Used especially in the phonetic base to disguise the
1381relationship between a planet and its star.
1383#### Accepts
1385#### Produces
1387`bot` is an atom.
1389`top` is an atom.
1391#### Source
1393```hoon
1394 ++ mu
1395 |_ [top/@ bot/@]
1396```
1398#### Examples
1400```
1401 > ~(. mu 0x20e5 0x5901)
1402 <3.sjm [[@ux @ux] <414.hhh 100.xkc 1.ypj %164>]>
1403```
1405------------------------------------------------------------------------
1407### `++zag:mu`
1409Add bottom into top
1411Produces the cell of `top` and `bot` with `top` scrambled to the result
1412of adding `bot` to `top` modulo 16. Used to scramble the name of a
1413planet.
1415#### Accepts
1417#### Produces
1419`bot` is an atom.
1421`top` is an atom.
1423#### Source
1425```hoon
1426 ++ zag [p=(end 4 1 (add top bot)) q=bot]
1427```
1429#### Examples
1431```
1432 > `[@ux @ux]`~(zag mu 0x20e0 0x201)
1433 [0x22e1 0x201]
1434```
1436------------------------------------------------------------------------
1438### `++zig:mu`
1440Subtract bottom from top
1442The inverse of `++zag`. Produces the cell of `top` and `bot` with
1443`top` unscrambled. The unscrambled `top` is the sum of the sample `top`
1444and the 16-bit complement of `bot`. Used to unscramble the name of the
1445planet.
1447#### Accepts
1449#### Produces
1451`bot` is an atom.
1453`top` is an atom.
1455#### Source
1457```hoon
1458 ++ zig [p=(end 4 1 (add top (sub 0x1.0000 bot))) q=bot]
1459```
1461#### Examples
1463```
1464 > `[@ux @ux]`~(zig mu 0x2f46 0x1042)
1465 [0x1f04 0x1042]
1466```
1468------------------------------------------------------------------------
1470### `++zug:mu`
1472Concatenate into atom
1474Produces the concatenation of `top` and `bot`. Used to assemble a
1475planet name.
1477#### Accepts
1479#### Produces
1481`bot` is an atom.
1483`top` is an atom.
1485#### Source
1487```hoon
1488 ++ zug (mix (lsh 4 1 top) bot)
1489```
1491#### Examples
1493```
1494 > `@ux`~(zug mu 0x10e1 0xfa)
1495 0x10e1.00fa
1496```
1499---
1500### `++ne`
1502Digit rendering engine
1504A door containing arms that render digits at bases 10, 16, 32, and
150564.
1507#### Accepts
1509#### Produces
1511`tig` is an `atom`.
1513#### Source
1515```hoon
1516 ++ ne
1517 |_ tig/@
1518```
1520#### Examples
1522```
1523 > ~(. ne 20)
1524 <4.gut [@ud <414.hhh 100.xkc 1.ypj %164>]>
1525```
1527------------------------------------------------------------------------
1529### `++d:ne`
1531Render decimal
1533Renders a decimal digit as an atom of an ACII byte value.
1535#### Accepts
1537#### Produces
1539`tig` is an `atom`.
1541#### Source
1543```hoon
1544 ++ d (add tig '0')
1545```
1547#### Examples
1549```
1550 > `@t`~(d ne 7)
1551 '7'
1553```
1555------------------------------------------------------------------------
1557### `++x:ne`
1559Render hex
1561Renders a hexadecimal digit as an atom of an ASCII byte value.
1563#### Accepts
1565#### Produces
1567`tig` is an `atom`.
1569#### Source
1571```hoon
1572 ++ x ?:((gte tig 10) (add tig 87) d)
1573```
1575#### Examples
1577```
1578 > `@t`~(x ne 7)
1579 '7'
1581 > `@t`~(x ne 14)
1582 'e'
1583```
1585------------------------------------------------------------------------
1587### `++v:ne`
1589Render base-32
1591Renders a base-32 digit as an atom of an ASCII byte value.
1593#### Accepts
1595#### Produces
1597#### Source
1599```hoon
1600 ++ v ?:((gte tig 10) (add tig 87) d)
1601```
1603#### Examples
1605```
1606 > `@t`~(v ne 7)
1607 '7'
1608 > `@t`~(v ne 14)
1609 'e'
1610 > `@t`~(v ne 25)
1611 'p'
1612```
1614------------------------------------------------------------------------
1616### `++w:ne`
1618Render base-64
1620Renders a base-64 digit as an atom of an ASCII byte value.
1622#### Accepts
1624#### Produces
1626`tig` is an `atom`.
1628#### Source
1630```hoon
1631 ++ w ?:(=(tig 63) '~' ?:(=(tig 62) '-' ?:((gte tig 36) (add tig 29) x)))
1632 --
1633 ::
1634```
1636#### Examples
1638```
1639 > `@t`~(w ne 7)
1640 '7'
1641 > `@t`~(w ne 14)
1642 'e'
1643 > `@t`~(w ne 25)
1644 'p'
1645 > `@t`~(w ne 52)
1646 'Q'
1647 > `@t`~(w ne 61)
1648 'Z'
1649 > `@t`~(w ne 63)
1650 '~'
1651 > `@t`~(w ne 62)
1652 '-'
1653```
1656---