Created
December 6, 2021 19:07
-
-
Save zicklag/feb30b217b07c013641dbfce16a754eb to your computer and use it in GitHub Desktop.
Base58 decode to array for Solana key from Phantom
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import bs58 from "https://cdn.skypack.dev/bs58"; | |
const bytes = bs58.decode(Deno.args[0]); | |
console.log(JSON.stringify(Array.from(bytes))); |
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
How to run the above code?