aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/envshare/util/base58.ts
blob: 7eeee95b573165c9819261fc6a47bb76d6dbffb1 (plain) (blame)
1
2
3
4
5
6
7
import baseX from "base-x";

const alphabet = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";

export const toBase58 = (b: Uint8Array) => baseX(alphabet).encode(b);

export const fromBase58 = (s: string) => baseX(alphabet).decode(s);