Advertisement
Guest User

Min Length Address Bash Script

a guest
Apr 17th, 2015
787
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #/bin/bash
  2. source bitcoin.sh
  3.  
  4. minlen=100;
  5. i=0;
  6. while [ 1 ]; do
  7.     mid=$(echo "obase=16; $i" | bc)
  8.     midlen=$(printf $mid | wc -c)
  9.     extra=$(expr 40 - $midlen)
  10.     mid=$(printf %0$(echo $extra)d)$mid
  11.     addr=$(hexToAddress $mid)
  12.     len=$(printf $addr | wc -c)
  13.     if [ $len -le $minlen ]; then
  14.         echo $len
  15.         echo $addr
  16.         minlen=$len
  17.     fi
  18.  
  19.     # sleep 0.1
  20.     let i+=1;
  21. done
Advertisement
RAW Paste Data Copied
Advertisement