I'm working on a Bitcoin brain wallet generator in Perl. I wasn't able to generate the private key (import format).
I have found a very simple bash script to generate the private key, and I will like to have it translated to Perl so I can make the key generation entirely on Perl.
Can someone help me to translate the following bash code to a Perl sub?
#!/bin/bash
base58=({1..9} {A..H} {J..N} {P..Z} {a..k} {m..z})
bc <<<"ibase=16; n=${1^^}; while(n>0) { n%3A ; n/=3A }" |
tac |
while read n
do echo -n ${base58[n]}
done