@Test public void testIsDataHash() { Assert.assertTrue(DataHash.isDataHash(VALID_SHA256_IMPRINT)); }
public static boolean isDataHash(byte[] imprint) { Util.notNull(imprint, "Hash imprint"); if (imprint.length < 1) { return false; } if (!HashAlgorithm.isHashAlgorithmId(imprint[0])) { return false; } HashAlgorithm algorithm = HashAlgorithm.getById(imprint[0]); return algorithm.getLength() + 1 == imprint.length; }
DataHash { public static boolean isDataHash(byte[] imprint) { Util.notNull(imprint, "Hash imprint"); if (imprint.length < 1) { return false; } if (!HashAlgorithm.isHashAlgorithmId(imprint[0])) { return false; } HashAlgorithm algorithm = HashAlgorithm.getById(imprint[0]); return algorithm.getLength() + 1 == imprint.length; } }
DataHash { public static boolean isDataHash(byte[] imprint) { Util.notNull(imprint, "Hash imprint"); if (imprint.length < 1) { return false; } if (!HashAlgorithm.isHashAlgorithmId(imprint[0])) { return false; } HashAlgorithm algorithm = HashAlgorithm.getById(imprint[0]); return algorithm.getLength() + 1 == imprint.length; } DataHash(HashAlgorithm algorithm, byte[] value);  DataHash(byte[] hashImprint); }
DataHash { public static boolean isDataHash(byte[] imprint) { Util.notNull(imprint, "Hash imprint"); if (imprint.length < 1) { return false; } if (!HashAlgorithm.isHashAlgorithmId(imprint[0])) { return false; } HashAlgorithm algorithm = HashAlgorithm.getById(imprint[0]); return algorithm.getLength() + 1 == imprint.length; } DataHash(HashAlgorithm algorithm, byte[] value);  DataHash(byte[] hashImprint); static boolean isDataHash(byte[] imprint); final HashAlgorithm getAlgorithm(); final byte[] getImprint(); final byte[] getValue(); @Override final int hashCode(); @Override final boolean equals(Object object); @Override final String toString(); }
DataHash { public static boolean isDataHash(byte[] imprint) { Util.notNull(imprint, "Hash imprint"); if (imprint.length < 1) { return false; } if (!HashAlgorithm.isHashAlgorithmId(imprint[0])) { return false; } HashAlgorithm algorithm = HashAlgorithm.getById(imprint[0]); return algorithm.getLength() + 1 == imprint.length; } DataHash(HashAlgorithm algorithm, byte[] value);  DataHash(byte[] hashImprint); static boolean isDataHash(byte[] imprint); final HashAlgorithm getAlgorithm(); final byte[] getImprint(); final byte[] getValue(); @Override final int hashCode(); @Override final boolean equals(Object object); @Override final String toString();  }