forked from TrueCloudLab/frostfs-sdk-java
parent
7518893388
commit
ab8a574d0d
14 changed files with 139 additions and 25 deletions
|
@ -11,15 +11,17 @@ import java.security.NoSuchAlgorithmException;
|
|||
import static java.util.Objects.isNull;
|
||||
|
||||
public class Helper {
|
||||
private static final int RIPEMD_160_HASH_BYTE_LENGTH = 20;
|
||||
|
||||
private Helper() {
|
||||
}
|
||||
|
||||
public static byte[] getRIPEMD160(byte[] value) {
|
||||
public static byte[] getRipemd160(byte[] value) {
|
||||
if (isNull(value)) {
|
||||
throw new IllegalArgumentException("Input value is missing");
|
||||
}
|
||||
|
||||
var hash = new byte[20];
|
||||
var hash = new byte[RIPEMD_160_HASH_BYTE_LENGTH];
|
||||
var digest = new RIPEMD160Digest();
|
||||
digest.update(value, 0, value.length);
|
||||
digest.doFinal(hash, 0);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue