List of usage examples for org.bouncycastle.crypto.digests SHA3Digest update
public void update(byte[] in, int inOff, int len)
From source file:org.thingsboard.server.common.msg.EncryptionUtil.java
License:Apache License
public static String getSha3Hash(String data) { String trimmedData = trimNewLines(data); byte[] dataBytes = trimmedData.getBytes(); SHA3Digest md = new SHA3Digest(256); md.reset();/*from w w w.ja v a2s. co m*/ md.update(dataBytes, 0, dataBytes.length); byte[] hashedBytes = new byte[256 / 8]; md.doFinal(hashedBytes, 0); String sha3Hash = ByteUtils.toHexString(hashedBytes); return sha3Hash; }