class Digest {

    public static byte[] digest(byte[] input)
        throws NoSuchAlgorithmException {

        byte [] digest = null;
        try{
            MessageDigest md = MessageDigest.getInstance(HASH_ID);
            digest = md.digest(input);
        }
        // let's panic if an exception occurs
        finally {
            return digest;
        }
    }

}