Skip to content

Instantly share code, notes, and snippets.

@zicklag
Created December 6, 2021 19:07
Show Gist options
  • Select an option

  • Save zicklag/feb30b217b07c013641dbfce16a754eb to your computer and use it in GitHub Desktop.

Select an option

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
Copy Markdown

How to run the above code?

@zicklag

zicklag commented Apr 6, 2024

Copy link
Copy Markdown
Author

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