@Test void sha3_512() { String horseSha3 = "d78700def5dd85a9f5a1f8cce8614889e696d4dc82b17189e4974acc050659b49494f03cd0bfbb13a32132b4b4af5e16efd8b0643a5453c87e8e6dfb086b3568"; String cowSha3 = "14accdcf3380cd31674aa5edcd2a53f1b1dad3922eb335e89399321e17a8be5ea315b5346a4c45f6a2595b8e2e24bb345daeb97c7ddd2e970b9e53c9ae439f23"; Bytes resultHorse = Hash.sha3_512(Bytes.wrap("horse".getBytes(UTF_8))); assertEquals(Bytes.fromHexString(horseSha3), resultHorse); byte[] resultHorse2 = Hash.sha3_512("horse".getBytes(UTF_8)); assertArrayEquals(Bytes.fromHexString(horseSha3).toArray(), resultHorse2); Bytes resultCow = Hash.sha3_512(Bytes.wrap("cow".getBytes(UTF_8))); assertEquals(Bytes.fromHexString(cowSha3), resultCow); byte[] resultCow2 = Hash.sha3_512("cow".getBytes(UTF_8)); assertArrayEquals(Bytes.fromHexString(cowSha3).toArray(), resultCow2); }
public static byte[] sha3_512(byte[] input) { try { return digestUsingAlgorithm(input, SHA3_512); } catch (NoSuchAlgorithmException e) { throw new IllegalStateException("Algorithm should be available but was not", e); } }
Hash { public static byte[] sha3_512(byte[] input) { try { return digestUsingAlgorithm(input, SHA3_512); } catch (NoSuchAlgorithmException e) { throw new IllegalStateException("Algorithm should be available but was not", e); } } }
Hash { public static byte[] sha3_512(byte[] input) { try { return digestUsingAlgorithm(input, SHA3_512); } catch (NoSuchAlgorithmException e) { throw new IllegalStateException("Algorithm should be available but was not", e); } } private  Hash(); }
Hash { public static byte[] sha3_512(byte[] input) { try { return digestUsingAlgorithm(input, SHA3_512); } catch (NoSuchAlgorithmException e) { throw new IllegalStateException("Algorithm should be available but was not", e); } } private  Hash(); static byte[] digestUsingAlgorithm(byte[] input, String alg); static Bytes digestUsingAlgorithm(Bytes input, String alg); static byte[] sha2_256(byte[] input); static Bytes32 sha2_256(Bytes input); static byte[] sha2_512_256(byte[] input); static Bytes32 sha2_512_256(Bytes input); static byte[] keccak256(byte[] input); static Bytes32 keccak256(Bytes input); static byte[] keccak512(byte[] input); static Bytes keccak512(Bytes input); static byte[] sha3_256(byte[] input); static Bytes32 sha3_256(Bytes input); static byte[] sha3_512(byte[] input); static Bytes sha3_512(Bytes input); }
Hash { public static byte[] sha3_512(byte[] input) { try { return digestUsingAlgorithm(input, SHA3_512); } catch (NoSuchAlgorithmException e) { throw new IllegalStateException("Algorithm should be available but was not", e); } } private  Hash(); static byte[] digestUsingAlgorithm(byte[] input, String alg); static Bytes digestUsingAlgorithm(Bytes input, String alg); static byte[] sha2_256(byte[] input); static Bytes32 sha2_256(Bytes input); static byte[] sha2_512_256(byte[] input); static Bytes32 sha2_512_256(Bytes input); static byte[] keccak256(byte[] input); static Bytes32 keccak256(Bytes input); static byte[] keccak512(byte[] input); static Bytes keccak512(Bytes input); static byte[] sha3_256(byte[] input); static Bytes32 sha3_256(Bytes input); static byte[] sha3_512(byte[] input); static Bytes sha3_512(Bytes input);  }