tron-scanner-app/src/main/kotlin/co/nilin/opex/chainscanner/tron/utils/Base58Check.java
// Returns a new byte array by concatenating the given array with its checksum.
Returns a new byte array by concatenating the given array with its checksum.
Returns a new byte array by concatenating the given array with its checksum .
static byte[] addCheckHash(byte[] data) {
        try {
            SHA256.Digest digest = new SHA256.Digest();
            digest.update(data);
            byte[] hash0 = digest.digest();
            digest.reset();
            digest.update(hash0);
            byte[] hash = Arrays.copyOf(digest.digest(), 4);
            ByteArrayOutputStream buf = new ByteArrayOutputStream();
            buf.write(data);
            buf.write(hash);
            return buf.toByteArray();
        } catch (IOException e) {
            throw new AssertionError(e);
        }
    }
static byte [ ] addCheckHash ( byte [ ] data ) { try { SHA256 . Digest digest = new SHA256 . Digest ( ) ; digest . update ( data ) ; byte [ ] hash0 = digest . digest ( ) ; digest . reset ( ) ; digest . update ( hash0 ) ; byte [ ] hash = Arrays . copyOf ( digest . digest ( ) , 4 ) ; ByteArrayOutputStream buf = new ByteArrayOutputStream ( ) ; buf . write ( data ) ; buf . write ( hash ) ; return buf . toByteArray ( ) ; } catch ( IOException e ) { throw new AssertionError ( e ) ; } }
Returns a new byte array by concatenating the given array with its checksum.
Returns a new byte array by concatenating the given array with its checksum .