public static byte[] fromBase58WithChecksum(String s) throws HyperLedgerException {
  byte[] b=fromBase58(s);
  if (b.length < 4) {
    throw new HyperLedgerException("Too short for checksum " + s);
  }
  byte[] cs=new byte[4];
  System.arraycopy(b,b.length - 4,cs,0,4);
  byte[] data=new byte[b.length - 4];
  System.arraycopy(b,0,data,0,b.length - 4);
  byte[] h=new byte[4];
  System.arraycopy(Hash.hash(data),0,h,0,4);
  if (Arrays.equals(cs,h)) {
    return data;
  }
  throw new HyperLedgerException("Checksum mismatch " + s);
}

public static byte [ ] fromBase58WithChecksum ( String s ) throws HyperLedgerException { byte [ ] b = fromBase58 ( s ) ; if ( b . length < 4 ) { throw new HyperLedgerException ( "Too short for checksum " + s ) ; } byte [ ] cs = new byte [ 4 ] ; System . arraycopy ( b , b . length - 4 , cs , 0 , 4 ) ; byte [ ] data = new byte [ b . length - 4 ] ; System . arraycopy ( b , 0 , data , 0 , b . length - 4 ) ; byte [ ] h = new byte [ 4 ] ; System . arraycopy ( Hash . hash ( data ) , 0 , h , 0 , 4 ) ; if ( Arrays . equals ( cs , h ) ) { return data ; } throw new HyperLedgerException ( "Checksum mismatch " + s ) ; }
decode from base58 assuming a trailing checksum of four bytes
