use of org.spongycastle.crypto.digests.RIPEMD160Digest in project aion by aionnetwork.
the class HashUtil method ripemd160.
/**
* Computes the ripemed160 hash fo the given input data.
*
* @param data Message to hash
* @return reipmd160 hash of the message
*/
public static byte[] ripemd160(byte[] data) {
Digest digest = new RIPEMD160Digest();
if (data != null) {
byte[] resBuf = new byte[digest.getDigestSize()];
digest.update(data, 0, data.length);
digest.doFinal(resBuf, 0);
return resBuf;
}
throw new NullPointerException("Can't hash a NULL value");
}
use of org.spongycastle.crypto.digests.RIPEMD160Digest in project rskj by rsksmart.
the class HashUtil method ripemd160.
/**
* @param data - message to hash
* @return - reipmd160 hash of the message
*/
public static byte[] ripemd160(byte[] data) {
Digest digest = new RIPEMD160Digest();
if (data != null) {
byte[] resBuf = new byte[digest.getDigestSize()];
digest.update(data, 0, data.length);
digest.doFinal(resBuf, 0);
return resBuf;
}
throw new NullPointerException("Can't hash a NULL value");
}
use of org.spongycastle.crypto.digests.RIPEMD160Digest in project nuls by nuls-io.
the class Utils method sha256hash160.
/**
* Calculates RIPEMD160(SHA256(input)). This is used in Address calculations.
*/
public static byte[] sha256hash160(byte[] input) {
byte[] sha256 = Sha256Hash.hash(input);
RIPEMD160Digest digest = new RIPEMD160Digest();
digest.update(sha256, 0, sha256.length);
byte[] out = new byte[20];
digest.doFinal(out, 0);
return out;
}
use of org.spongycastle.crypto.digests.RIPEMD160Digest in project AppCoins-ethereumj by AppStoreFoundation.
the class HashUtil method ripemd160.
/**
* @param data - message to hash
*
* @return - reipmd160 hash of the message
*/
public static byte[] ripemd160(byte[] data) {
Digest digest = new RIPEMD160Digest();
if (data != null) {
byte[] resBuf = new byte[digest.getDigestSize()];
digest.update(data, 0, data.length);
digest.doFinal(resBuf, 0);
return resBuf;
}
throw new NullPointerException("Can't hash a NULL value");
}
use of org.spongycastle.crypto.digests.RIPEMD160Digest in project balzac by balzac-lang.
the class BitcoinUtils method ripemd160.
public static Hash ripemd160(byte[] bytes) {
RIPEMD160Digest digest = new RIPEMD160Digest();
digest.update(bytes, 0, bytes.length);
byte[] ripmemdHash = new byte[20];
digest.doFinal(ripmemdHash, 0);
return new Hash(ripmemdHash);
}
Aggregations