+ public static String digest(String algorithm, byte[] bytes) {
+ try {
+ MessageDigest digest = MessageDigest.getInstance(algorithm);
+ digest.update(bytes);
+ byte[] checksum = digest.digest();
+ String res = StreamUtils.encodeHexString(checksum);
+ return res;
+ } catch (Exception e) {
+ throw new ArgeoException("Cannot digest with algorithm "
+ + algorithm, e);
+ }
+ }
+