on bbd4189 help sign in
1654 lines 20 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
210#### Source
212```hoon
213 ++ pew (bass 64 ;~(plug sew (stun [0 4] siw)))
214```
216#### Examples
218```
219 > (scan "Q" pew:ab)
220 q=52
221 > (scan "aQ~9" pew:ab)
222 q=2.838.473
223 > `@`0waQ~9
224 2.838.473
225 > (scan "123456" pew:ab)
226 ! {1 6}
227 ! exit
228 > (scan "012345" pew:ab)
229 ! {1 1}
230 ! exit
231```
233---
235### `++piv:ab`
237Parse 5 base-32
239Parsing `++rule`. Parses exactly five base-32 digits.
241#### Accepts
243#### Produces
245#### Source
247```hoon
248 ++ piv (bass 32 (stun [5 5] siv))
249```
251#### Examples
253```
254 > (scan "10b3l" piv:ab)
255 q=1.059.957
256 > (scan "1" piv:ab)
257 ! {1 2}
258 ! exit
259```
261---
263### `++piw:ab`
265Parse 5 base-64
267Parsing `++rule`. Parses exactly five base-64 digits.
269#### Accepts
271#### Produces
273#### Source
275```hoon
276 ++ piw (bass 64 (stun [5 5] siw))
277```
279#### Examples
281```
282 > (scan "2C-pZ" piw:ab)
283 q=43.771.517
284 > (scan "2" piv:ab)
285 ! {1 2}
286 ! exit
287```
289---
291### `++qeb:ab`
293Parse \<= 4 binary
295Parsing `++rule`. Parses a binary number of up to 4 digits in length without
296a leading zero.
298#### Accepts
300#### Produces
302#### Source
304```hoon
305 ++ qeb (bass 2 ;~(plug seb (stun [0 3] sib)))
306```
308#### Examples
310```
311 > (scan "1" qeb:ab)
312 q=1
313 > (scan "101" qeb:ab)
314 q=5
315 > (scan "1111" qeb:ab)
316 q=15
317 > (scan "11111" qeb:ab)
318 ! {1 5}
319 ! exit
320 > (scan "01" qeb:ab)
321 ! {1 1}
322 ! exit
323```
325---
327### `++qex:ab`
329Parse \<= 4 hex
331Parsing `++rule`. Parses a hexadecimal number of up to 4 digits in length
332without a leading zero.
334#### Accepts
336#### Produces
338#### Source
340```hoon
341 ++ qex (bass 16 ;~(plug sex (stun [0 3] hit)))
342```
344#### Examples
346```
347 > (scan "ca" qex:ab)
348 q=202
349 > (scan "18ac" qex:ab)
350 q=6.316
351 > (scan "18acc" qex:ab)
352 ! {1 5}
353 ! exit
354 > (scan "08ac" qex:ab)
355 ! {1 1}
356 ! exit
357```
359---
361### `++qib:ab`
363Parse 4 binary
365Parsing `++rule`. Parses exactly four binary digits.
367#### Accepts
369#### Produces
371#### Source
373```hoon
374 ++ qib (bass 2 (stun [4 4] sib))
375```
377#### Examples
379```
380 > (scan "0001" qib:ab)
381 q=1
382 > (scan "0100" qib:ab)
383 q=4
384 > (scan "110" qib:ab)
385 ! {1 4}
386 ! exit
387```
389---
391### `++qix:ab`
393Parse 4 hex
395Parsing `++rule`. Parses exactly four hexadecimal digits.
397#### Accepts
399#### Produces
401#### Source
403```hoon
404 ++ qix (bass 16 (stun [4 4] six))
405```
407#### Examples
409```
410 > (scan "0100" qix:ab)
411 q=256
412 > (scan "10ff" qix:ab)
413 q=4.351
414 > (scan "0" qix:ab)
415 ! {1 2}
416 ! exit
417```
419---
421### `++seb:ab`
423Parse 1
425Parsing `++rule`. Parses the number 1.
427#### Accepts
429#### Produces
431#### Source
433```hoon
434 ++ seb (cold 1 (just '1'))
435```
437#### Examples
439```
440 > (scan "1" seb:ab)
441 1
442 > (scan "0" seb:ab)
443 ! ~zod/try/~2014.10.23..22.34.21..bfdd/:<[1 1].[1 18]>
444 ! {1 1}
445 > (scan "2" seb:ab)
446 ! ~zod/try/~2014.10.23..22.34.29..d399/:<[1 1].[1 18]>
447 ! {1 1}
448```
450---
452### `++sed:ab`
454Parse decimal
456Parsing `++rule`. Parses a nonzero decimal digit.
458#### Accepts
460#### Produces
462#### Source
464```hoon
465 ++ sed (cook |=(a/@ (sub a '0')) (shim '1' '9'))
466```
468#### Examples
470```
471 > (scan "5" sed:ab)
472 5
473 > (scan "0" sed:ab)
474 ! {1 1}
475 ! exit
476```
478---
480### `++sev:ab`
482Parse base-32
484Parsing `++rule`. Parses a nonzero base-32 digit
486#### Accepts
488#### Produces
490#### Source
492```hoon
493 ++ sev ;~(pose sed sov)
494```
496#### Examples
498```
499 > (scan "c" sev:ab)
500 12
501 ~zod/socialnet=> (scan "0" sev:ab)
502 ! {1 1}
503 ! exit
504```
506---
508### `++sew:ab`
510Parse base-64
512Parsing `++rule`. Parses a nonzero base-64 digit
514#### Accepts
516#### Produces
518#### Source
520```hoon
521 ++ sew ;~(pose sed sow)
522```
524#### Examples
526```
527 > (scan "M" sew:ab)
528 48
529 > (scan "0" sew:ab)
530 ! {1 1}
531 ! exit
532```
534---
536### `++sex:ab`
538Parse hex
540Parsing `++rule`. Parses a nonzero hexadecimal digit.
542#### Accepts
544#### Produces
546#### Source
548```hoon
549 ++ sex ;~(pose sed sox)
550```
552#### Examples
554```
555 > (scan "e" sex:ab)
556 14
557 > (scan "0" sex:ab)
558 ! {1 1}
559 ! exit
560```
562---
564### `++sib:ab`
566Parse binary
568Parsing `++rule`. Parses a binary digit.
570#### Accepts
572#### Produces
574#### Source
576```hoon
577 ++ sib (cook |=(a/@ (sub a '0')) (shim '0' '1'))
578```
580#### Examples
582```
583 > (scan "1" sib:ab)
584 1
585 ~zod/socialnet=> (scan "0" sib:ab)
586 0
587```
589---
591### `++sid:ab`
593Parse decimal
595Parsing `++rule`. Parses a decimal digit.
597#### Accepts
599#### Produces
601#### Source
603```hoon
604 ++ sid (cook |=(a/@ (sub a '0')) (shim '0' '9'))
605```
607#### Examples
609```
610 > (scan "5" sid:ab)
611 5
612```
614---
616### `++siv:ab`
618Parse base-32
620Parsing `++rule`. Parses a base-32 digit.
622#### Accepts
624#### Produces
626#### Source
628```hoon
629 ++ siv ;~(pose sid sov)
630```
632#### Examples
634```
635 > (scan "c" siv:ab)
636 12
637```
639---
641### `++siw:ab`
643Parse base-64
645Parsing `++rule`. Parses a base-64 digit.
647#### Accepts
649#### Produces
651#### Source
653```hoon
654 ++ siw ;~(pose sid sow)
655```
657#### Examples
659```
660 > (scan "M" siw:ab)
661 48
662```
664---
666### `++six:ab`
668Parse hex
670Parsing `++rule`. Parses a hexadecimal digit.
672#### Accepts
674#### Produces
676#### Source
678```hoon
679 ++ six ;~(pose sid sox)
680```
682#### Examples
684```
685 > (scan "e" six:ab)
686 14
687```
689---
691### `++sov:ab`
693Parse base-32
695Parsing `++rule`. Parses a base-32 letter.
697#### Accepts
699#### Produces
701#### Source
703```hoon
704 ++ sov (cook |=(a/@ (sub a 87)) (shim 'a' 'v'))
705```
707#### Examples
709```
710 > (scan "c" sov:ab)
711 12
712```
714---
716### `++sow:ab`
718Parse base-64
720Parsing `++rule`. Parses a base-64 letter/symbol.
722#### Accepts
724#### Produces
726#### Source
728```hoon
729 ++ sow ;~ pose
730 (cook |=(a/@ (sub a 87)) (shim 'a' 'z'))
731 (cook |=(a/@ (sub a 29)) (shim 'A' 'Z'))
732 (cold 62 (just '-'))
733 (cold 63 (just '~'))
734 ==
735```
737#### Examples
739```
740 > (scan "M" sow:ab)
741 48
742```
744---
746### `++sox:ab`
748Parse hex letter
750Parsing `++rule`. Parses a hexadecimal letter.
752#### Accepts
754#### Produces
756#### Source
758```hoon
759 ++ sox (cook |=(a/@ (sub a 87)) (shim 'a' 'f'))
760```
762#### Examples
764```
765 > (scan "e" sox:ab)
766 14
767```
769---
771### `++ted:ab`
773Parse \<= 3 decimal
775Parsing `++rule`. Parses a decimal number of up to 3 digits without a
776leading zero.
778#### Accepts
780#### Produces
782#### Source
784```hoon
785 ++ ted (bass 10 ;~(plug sed (stun [0 2] sid)))
786```
788#### Examples
790```
791 > (scan "21" ted:ab)
792 q=21
793 > (scan "214" ted:ab)
794 q=214
795 > (scan "2140" ted:ab)
796 {1 4}
797 > (scan "0" ted:ab)
798 ! {1 1}
799 ! exit
800```
802---
804### `++tip:ab`
806Leading phonetic byte
808Parsing `++rule`. Parses the leading phonetic byte, which represents a
809syllable.
811#### Accepts
813#### Produces
815#### Source
817```hoon
818 ++ tip (sear |=(a/@ (ins:po a)) til)
819```
821#### Examples
823```
824 > (scan "doz" tip:ab)
825 0
827 > (scan "pit" tip:ab)
828 242
829```
831---
833### `++tiq:ab`
835Trailing phonetic syllable
837Parsing `++rule`. Parses the trailing phonetic byte, which represents a
838syllable.
840#### Accepts
842#### Produces
844#### Source
846```hoon
847 ++ tiq (sear |=(a/@ (ind:po a)) til)
849```
851#### Examples
853```
854 > (scan "zod" tiq:ab)
855 0
856 > (scan "nec" tiq:ab)
857 1
858```
860---
862### `++tid:ab`
864Parse 3 decimal digits
866Parsing `++rule`. Parses exactly three decimal digits.
868#### Accepts
870#### Produces
872#### Source
874```hoon
875 ++ tid (bass 10 (stun [3 3] sid))
876```
878#### Examples
880```
881 > (scan "013" tid:ab)
882 q=13
883 > (scan "01" tid:ab)
884 ! {1 3}
885 ! exit
886```
888---
890### `++til:ab`
892Parse 3 lowercase
894Parsing `++rule`. Parses exactly three lowercase letters.
896#### Accepts
898#### Produces
900#### Source
902```hoon
903 ++ til (boss 256 (stun [3 3] low))
904```
906#### Examples
908```
909 > (scan "mer" til:ab)
910 q=7.497.069
911 > `@t`(scan "mer" til:ab)
912 'mer'
913 > (scan "me" til:ab)
914 ! {1 3}
915 ! exit
916```
918---
920### `++urs:ab`
922Parse span characters
924Parsing rule. Parses characters from an atom of the span aura `@ta`.
926#### Accepts
928#### Produces
930#### Source
932```hoon
933 ++ urs %+ cook
934 |=(a/tape (rap 3 ^-((list @) a)))
935 (star ;~(pose nud low hep dot sig cab))
936```
938#### Examples
940```
941 > `@ta`(scan "asa-lom_tak" urs:ab)
942 ~.asa-lom_tak
943 > `@t`(scan "asa-lom_tak" urs:ab)
944 'asa-lom_tak'
945```
947---
949### `++urt:ab`
951Parse non-`_` span
953Parsing rule. Parses all characters of the span aura `@ta` except
954for cab, `_`.
956#### Accepts
958#### Produces
960#### Source
962```hoon
963 ++ urt %+ cook
964 |=(a/tape (rap 3 ^-((list @) a)))
965 (star ;~(pose nud low hep dot sig))
966```
968#### Examples
970```
971 > `@t`(scan "asa-lom.t0k" urt:ab)
972 'asa-lom.t0k'
973```
975---
977### `++voy:ab`
979Parse bas, soq, or bix
981Parsing rule. Parses an escaped backslash, single quote, or hex pair
982byte.
984#### Accepts
986#### Produces
988#### Source
990```hoon
991 ++ voy ;~(pfix bas ;~(pose bas soq bix))
992```
994#### Examples
996```
997 > (scan "\\0a" voy:ab)
998 q=10
999 > (scan "\\'" voy:ab)
1000 q=39
1001```
1003---
1005## `++ag`
1007Top-level atom parser engine
1009A core containing top-level atom parsers.
1011#### Accepts
1013#### Produces
1015#### Source
1017```hoon
1018 ++ ag
1019 |%
1020```
1022#### Examples
1024```
1025 > ag
1026 <14.vpu 414.mof 100.xkc 1.ypj %164>
1027```
1029---
1031### `++ape:ag`
1033Parse 0 or rule
1035Parser modifier. Parses 0 or the sample rule `fel`.
1037#### Accepts
1039#### Produces
1041`fel` is a `rule`.
1043#### Source
1045```hoon
1046 ++ ape |*(fel/rule ;~(pose (cold 0 (just '0')) fel))
1047```
1049#### Examples
1051```
1052 > (scan "202" (star (ape:ag (cold 2 (just '2')))))
1053 ~[2 0 2]
1054```
1056---
1058### `++bay:ag`
1060Parses binary number
1062Parsing rule. Parses a binary number without a leading zero.
1064#### Accepts
1066#### Produces
1068#### Source
1070```hoon
1071 ++ bay (ape (bass 16 ;~(plug qeb:ab (star ;~(pfix dog qib:ab)))))
1072```
1074#### Examples
1076```
1077 > (scan "10.0110" bay:ag)
1078 q=38
1079```
1081---
1083### `++bip:ag`
1085Parse IPv6
1087Parsing rule. Parses a `@is`, an IPv6 address.
1089#### Accepts
1091#### Produces
1093#### Source
1095```hoon
1096 ++ bip =+ tod=(ape qex:ab)
1097 (bass 0x1.0000 ;~(plug tod (stun [7 7] ;~(pfix dog tod))))
1098```
1100#### Examples
1102```
1103 > (scan "0.0.ea.3e6c.0.0.0.0" bip:ag)
1104 q=283.183.420.760.121.105.516.068.864
1105 > `@is`(scan "0.0.ea.3e6c.0.0.0.0" bip:ag)
1106 .0.0.ea.3e6c.0.0.0.0
1107```
1109---
1111### `++dem:ag`
1113Parse decimal with dots
1115Parsing rule. Parses a decimal number that includes dot separators.
1117#### Accepts
1119#### Produces
1121#### Source
1123```hoon
1124 ++ dem (ape (bass 1.000 ;~(plug ted:ab (star ;~(pfix dog tid:ab)))))
1125```
1127#### Examples
1129```
1130 > (scan "52" dem:ag)
1131 q=52
1132 > (scan "13.507" dem:ag)
1133 q=13.507
1134```
1136---
1138### `++dim:ag`
1140Parse decimal number
1142Parsing rule. Parses a decimal number without a leading zero.
1144#### Accepts
1146#### Produces
1148#### Source
1150```hoon
1151 ++ dim (ape (bass 10 ;~(plug sed:ab (star sid:ab))))
1152```
1154#### Examples
1156```
1157 > (scan "52" dim:ag)
1158 q=52
1159 > (scan "013507" dim:ag)
1160 ! {1 2}
1161 ! exit
1162```
1164---
1166### `++dum:ag`
1168Parse decimal with leading `0`
1170Parsing rule. Parses a decmial number with leading zeroes.
1172#### Accepts
1174#### Produces
1176#### Source
1178```hoon
1179 ++ dum (bass 10 (plus sid:ab))
1180```
1182#### Examples
1184```
1185 > (scan "52" dum:ag)
1186 q=52
1187 > (scan "0000052" dum:ag)
1188 q=52
1189 > (scan "13507" dim:ag)
1190 q=13.507
1191```
1193---
1195### `++fed:ag`
1197Parse phonetic base
1199Parsing rule. Parses an atom of aura `@p`, the phonetic base.
1201#### Accepts
1203#### Produces
1205#### Source
1207```hoon
1208 ++ fed ;~ pose
1209 (bass 0x1.0000.0000.0000.0000 (most doh hyf:ab))
1210 huf:ab
1211 hif:ab
1212 tiq:ab
1213 ==
1214```
1216#### Examples
1218```
1219 > (scan "zod" fed:ag)
1221 > (scan "nec" fed:ag)
1223 > (scan "sondel" fed:ag)
1224 9.636
1225 > ~tillyn-nillyt
1226 ~tillyn-nillyt
1227 > (scan "tillyn-nillyt" fed:ag)
1228 3.569.565.175
1229 > (scan "tillyn-nillyt-tasfyn-partyv" fed:ag)
1230 15.331.165.687.565.582.592
1231 > (scan "tillyn-nillyt-tasfyn-partyv--novweb-talrud-talmud-sonfyr" fed:ag)
1232 282.810.089.790.159.633.869.501.053.313.363.681.181
1233```
1235---
1237### `++hex:ag`
1239Parse hex
1241Parsing rule. Parses a hexadecimal number
1243#### Accepts
1245#### Produces
1247#### Source
1249```hoon
1250 ++ hex (ape (bass 0x1.0000 ;~(plug qex:ab (star ;~(pfix dog qix:ab)))))
1251```
1253#### Examples
1255```
1256 > (scan "4" hex:ag)
1257 q=4
1258 > (scan "1a" hex:ag)
1259 q=26
1260 > (scan "3.ac8d" hex:ag)
1261 q=240.781
1262 > `@ux`(scan "3.ac8d" hex:ag)
1263 0x3.ac8d
1264```
1266---
1268### `++lip:ag`
1270Parse IPv4 address
1272Parsing rule. Parses an IPv4 address.
1274#### Accepts
1276#### Produces
1278#### Source
1280```hoon
1281 ++ lip =+ tod=(ape ted:ab)
1282 (bass 256 ;~(plug tod (stun [3 3] ;~(pfix dog tod))))
1283```
1285#### Examples
1287```
1288 > (scan "127.0.0.1" lip:ag)
1289 q=2.130.706.433
1290 > `@if`(scan "127.0.0.1" lip:ag)
1291 .127.0.0.1
1292 > `@if`(scan "8.8.8.8" lip:ag)
1293 .8.8.8.8
1294```
1296---
1298### `++viz:ag`
1300Parse Base-32 with dots
1302Parsing rule. Parses a Base-32 number with dot separators.
1304#### Accepts
1306#### Produces
1308#### Source
1310```hoon
1311 ++ viz (ape (bass 0x200.0000 ;~(plug pev:ab (star ;~(pfix dog piv:ab)))))
1312```
1314#### Examples
1316```
1317 > (scan "e2.ol4pm" viz:ag)
1318 q=15.125.353.270
1319```
1321---
1323### `++vum:ag`
1325Parse base-32 string
1327Parsing rule. Parses a raw base-32 string.
1329#### Accepts
1331#### Produces
1333#### Source
1335```hoon
1336 ++ vum (bass 32 (plus siv:ab))
1337```
1339#### Examples
1341```
1342 > (scan "e2ol4pm" vum:ag)
1343 q=15.125.353.270
1344```
1346---
1348### `++wiz:ag`
1350Parse base-64
1352Parsing rule. Parses a base-64 number.
1354#### Accepts
1356#### Produces
1358#### Source
1360```hoon
1361 ++ wiz (ape (bass 0x4000.0000 ;~(plug pew:ab (star ;~(pfix dog piw:ab)))))
1362 --
1363 ::
1364```
1366#### Examples
1368```
1369 > (scan "e2O.l4Xpm" wiz:ag)
1370 q=61.764.130.813.526
1371```
1373---
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```
1498---
1500## `++ne`
1502Digit rendering engine
1504A door containing arms that render digits at bases 10, 16, 32, and 64.
1506#### Accepts
1508#### Produces
1510`tig` is an `atom`.
1512#### Source
1514```hoon
1515 ++ ne
1516 |_ tig/@
1517```
1519#### Examples
1521```
1522 > ~(. ne 20)
1523 <4.gut [@ud <414.hhh 100.xkc 1.ypj %164>]>
1524```
1526---
1528### `++d:ne`
1530Render decimal
1532Renders a decimal digit as an atom of an ACII byte value.
1534#### Accepts
1536#### Produces
1538`tig` is an `atom`.
1540#### Source
1542```hoon
1543 ++ d (add tig '0')
1544```
1546#### Examples
1548```
1549 > `@t`~(d ne 7)
1550 '7'
1552```
1554---
1556### `++x:ne`
1558Render hex
1560Renders a hexadecimal digit as an atom of an ASCII byte value.
1562#### Accepts
1564#### Produces
1566`tig` is an `atom`.
1568#### Source
1570```hoon
1571 ++ x ?:((gte tig 10) (add tig 87) d)
1572```
1574#### Examples
1576```
1577 > `@t`~(x ne 7)
1578 '7'
1580 > `@t`~(x ne 14)
1581 'e'
1582```
1584---
1586### `++v:ne`
1588Render base-32
1590Renders a base-32 digit as an atom of an ASCII byte value.
1592#### Accepts
1594#### Produces
1596#### Source
1598```hoon
1599 ++ v ?:((gte tig 10) (add tig 87) d)
1600```
1602#### Examples
1604```
1605 > `@t`~(v ne 7)
1606 '7'
1607 > `@t`~(v ne 14)
1608 'e'
1609 > `@t`~(v ne 25)
1610 'p'
1611```
1613---
1615### `++w:ne`
1617Render base-64
1619Renders a base-64 digit as an atom of an ASCII byte value.
1621#### Accepts
1623#### Produces
1625`tig` is an `atom`.
1627#### Source
1629```hoon
1630 ++ w ?:(=(tig 63) '~' ?:(=(tig 62) '-' ?:((gte tig 36) (add tig 29) x)))
1631 --
1632 ::
1633```
1635#### Examples
1637```
1638 > `@t`~(w ne 7)
1639 '7'
1640 > `@t`~(w ne 14)
1641 'e'
1642 > `@t`~(w ne 25)
1643 'p'
1644 > `@t`~(w ne 52)
1645 'Q'
1646 > `@t`~(w ne 61)
1647 'Z'
1648 > `@t`~(w ne 63)
1649 '~'
1650 > `@t`~(w ne 62)
1651 '-'
1652```
1654---