Skip to content

Instantly share code, notes, and snippets.

@koopa
Created August 10, 2012 07:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save koopa/3312406 to your computer and use it in GitHub Desktop.
Save koopa/3312406 to your computer and use it in GitHub Desktop.
b256 encoded bash script to convert b256 bytestreams to decimal base (i.e. the opposite of ${someNumber}P | dc)
echo -n 854093087332512253435501864310183940832507192295408000409585604916211200592875203742019876251460711432696057019874315744931750517095889492131800997746702733165802618078266538681934134707734651380433757630496880967089210126694690159204434191529802990945865852403285492423032065203717560182632592460338054710209764656288796916394348044515731959664426101097102547777847516813482416752677237712567111866117965501855654977688650120195396741643253571299579569997393719893460802728847979024867547108671378728815246433542993568911646314269224796266872842346367340309188722360077652496830559P | dc | tr '_%?' '\n *'
@koopa
Copy link
Author

koopa commented Jul 21, 2019

if no negative lengths are allowed echo $(echo ${bc:0:${#bc}-1} | bc)P

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment