2title = "4a: Exotic Bases"
11Container core for providing phonetic syllables and name generators for the
12Urbit naming system. The two faces, `sis` and `dex`, are available to the
19=+ :- ^= sis :: prefix syllables
20 'dozmarbinwansamlitsighidfidlissogdirwacsabwissib\
21 /rigsoldopmodfoglidhopdardorlorhodfolrintogsilmir\
22 /holpaslacrovlivdalsatlibtabhanticpidtorbolfosdot\
23 /losdilforpilramtirwintadbicdifrocwidbisdasmidlop\
24 /rilnardapmolsanlocnovsitnidtipsicropwitnatpanmin\
25 /ritpodmottamtolsavposnapnopsomfinfonbanmorworsip\
26 /ronnorbotwicsocwatdolmagpicdavbidbaltimtasmallig\
27 /sivtagpadsaldivdactansidfabtarmonranniswolmispal\
28 /lasdismaprabtobrollatlonnodnavfignomnibpagsopral\
29 /bilhaddocridmocpacravripfaltodtiltinhapmicfanpat\
30 /taclabmogsimsonpinlomrictapfirhasbosbatpochactid\
31 /havsaplindibhosdabbitbarracparloddosbortochilmac\
32 /tomdigfilfasmithobharmighinradmashalraglagfadtop\
33 /mophabnilnosmilfopfamdatnoldinhatnacrisfotribhoc\
34 /nimlarfitwalrapsarnalmoslandondanladdovrivbacpol\
35 /laptalpitnambonrostonfodponsovnocsorlavmatmipfip'
36 ^= dex :: suffix syllables
37 'zodnecbudwessevpersutletfulpensytdurwepserwylsun\
38 /rypsyxdyrnuphebpeglupdepdysputlughecryttyvsydnex\
39 /lunmeplutseppesdelsulpedtemledtulmetwenbynhexfeb\
40 /pyldulhetmevruttylwydtepbesdexsefwycburderneppur\
41 /rysrebdennutsubpetrulsynregtydsupsemwynrecmegnet\
42 /secmulnymtevwebsummutnyxrextebfushepbenmuswyxsym\
43 /selrucdecwexsyrwetdylmynmesdetbetbeltuxtugmyrpel\
44 /syptermebsetdutdegtexsurfeltudnuxruxrenwytnubmed\
45 /lytdusnebrumtynseglyxpunresredfunrevrefmectedrus\
46 /bexlebduxrynnumpyxrygryxfeptyrtustyclegnemfermer\
47 /tenlusnussyltecmexpubrymtucfyllepdebbermughuttun\
48 /bylsudpemdevlurdefbusbeprunmelpexdytbyttyplevmyl\
49 /wedducfurfexnulluclennerlexrupnedlecrydlydfenwel\
50 /nydhusrelrudneshesfetdesretdunlernyrsebhulryllud\
51 /remlysfynwerrycsugnysnyllyndyndemluxfedsedbecmun\
52 /lyrtesmudnytbyrsenwegfyrmurtelreptegpecnelnevfes'
62Produces the byte of the right-hand syllable `a`.
79 ?:(=(256 b) ~ ?:(=(a (tod b)) [~ b] $(b +(b))))
105Produces the byte of the left-hand phonetic syllable `a`.
122 ?:(=(256 b) ~ ?:(=(a (tos b)) [~ b] $(b +(b))))
148Produces the phonetic suffix syllable from index `a` within `dex` as an atom.
162 |=(a=@ ?>((lth a 256) (cut 3 [(mul 3 a) 3] dex)))
184dojo: hoon expression failed
193Produces the phonetic prefix syllable from index `a` within `sis` as an atom.
207 |=(a=@ ?>((lth a 256) (cut 3 [(mul 3 a) 3] sis)))
229dojo: hoon expression failed
238Container core for base58check (e.g. bitcoin address) functions.
244 =+ key='123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'
246 =- yek:(roll (rip 3 key) -)
247 =+ [a=*char b=*@ yek=`@ux`(fil 3 256 0xff)]
249 [+(b) (mix yek (lsh [3 `@u`a] (~(inv fe 3) b)))]
257Decode base58check character
259Check whether character `a` is valid in base58check encoding, producing a `unit` of its decoded value if it's valid, and a null `unit` if it's not.
272++ cha |=(a=char `(unit @uF)`=+(b=(cut 3 [`@`a 1] yek) ?:(=(b 0xff) ~ `b)))
296Compute base58check checksum
298Compute the base58check checksum of `a`.
314 =- (~(net fe 5) (end [3 4] (shay 32 -)))
315 (shay (add b (met 3 a)) (lsh [3 b] (swp 3 a)))
321> (tok:fa 0xdead.beef)
329base58check padding bytes
331Compute the number of bytes of 0s needed to pad `a` to 21 bytes, if it's less
336`a` is a `@` - a value without its base58check checksum.
345++ pad |=(a=@ =+(b=(met 3 a) ?:((gte b 21) 0 (sub 21 b))))
351> (pad:fa 0xdead.beef)
361Compute and append checksum to `a`.
374++ enc |=(a=@ux `@ux`(mix (lsh [3 4] a) (tok a)))
380> (enc:fa 0xdead.beef)
390Check checksum of `a`, return a `unit` of `a` sans the checksum if successful,
391or a null `unit` otherwise.
405 |= a=@ux ^- (unit @ux)
407 ?. =((tok b) (end [3 4] a))
415> (den:fa 0xdead.beef.938b.8b0c)
420> (den:fa 0xdead.beef.1111.1111)
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list