Skip to content

Instantly share code, notes, and snippets.

@zicklag
Created December 6, 2021 19:07
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save zicklag/feb30b217b07c013641dbfce16a754eb to your computer and use it in GitHub Desktop.
Save zicklag/feb30b217b07c013641dbfce16a754eb to your computer and use it in GitHub Desktop.
Base58 decode to array for Solana key from Phantom
import bs58 from "https://cdn.skypack.dev/bs58";
const bytes = bs58.decode(Deno.args[0]);
console.log(JSON.stringify(Array.from(bytes)));
@cryptopolka
Copy link

How to run the above code?

@zicklag
Copy link
Author

zicklag commented Apr 6, 2024

You can run it with Deno:

$ deno run https://gist.github.com/zicklag/feb30b217b07c013641dbfce16a754eb/raw/471f27ba6dcda188cfbd83f44299637653bfc56a/base58-to-array.ts 61iSdHF9x9pf9qjqfze44CvHtBBC4fj8k7kjQKH3kZUo
[74,121,75,5,19,156,39,35,5,228,235,79,173,204,132,162,65,223,106,211,173,173,217,39,123,122,191,58,173,18,141,164]

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