summaryrefslogtreecommitdiff
path: root/modules/vendor-nabu/src/main/java/org/peergos/Hash.java
blob: 6c886289952609be54ba5111f20404000c952c6a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
package org.peergos;

import java.security.*;

public class Hash {

    public static byte[] sha256(byte[] in) {
        try {
            MessageDigest hasher = MessageDigest.getInstance("SHA-256");
            return hasher.digest(in);
        } catch (NoSuchAlgorithmException e) {
            throw new RuntimeException(e);
        }
    }
}