logoalt Hacker News

rjelitoday at 6:47 AM0 repliesview on HN

See also the @p encoding system used in urbit: https://cp4space.hatsya.com/2021/05/12/urbit-for-mathematici... https://github.com/urbit/urbit-ob

  > ob.patp('0')
  '~zod'
  > ob.patp2dec('~nidsut-tomdun')
  '15663360'
  > ob.hex2patq('010203')
  '~doznec-binwes'
  > ob.patq2hex('~marned-wismul-nilsev-botnyt')
  '01ca0e51d20462f3'
  > ob.isValidPatq('~marned-wismul-nilsev-botnyt')
  > true
Each byte is converted to a three letter syllable, from a hand-written LUT optimized for pronounceability, & different LUTs for even and odd bytes.