Copyright | (c) 2019 Jared Tobin |
---|---|
License | MIT |
Maintainer | Jared Tobin <jared@jtobin.io> |
Stability | unstable |
Portability | ghc |
Safe Haskell | None |
Language | Haskell2010 |
General functions for atom printing.
Roughly analogous to the +co arm in hoon.hoon.
Documentation
Hoon's @p encoding.
This encoding is an obfuscated representation of some underlying number, but a pronounceable, memorable, and unique one.
The representation exists for any natural number, but it's typically used only for naming Azimuth points, and thus normal 32-bit Urbit ships.
(It's also used for naming comets, i.e. self-signed 128-bit Urbit ships.)
patp :: Natural -> Patp Source #
Convert a Natural
to @p.
>>>
patp 0
~zod>>>
patp 256
~marzod>>>
patp 65536
~dapnep-ronmyl>>>
patp 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
~fipfes-fipfes-fipfes-fipfes--fipfes-fipfes-fipfes-fipfes
fromPatp :: Patp -> Natural Source #
Convert a @p value to its corresponding Natural
.
>>>
let zod = patp 0
>>>
fromPatp zod
0