@Test public void testsha1sum4bytes() throws NoSuchAlgorithmException, IllegalArgumentException { byte[] sha1sum; sha1sum = HashUtil.sha1sum("354934".getBytes(), 0, 4); }
public static byte[] sha1sum(byte[] data, Integer startIdxInc, Integer stopIdxExc) throws NoSuchAlgorithmException { byte[] out; MessageDigest md; md = MessageDigest.getInstance("SHA-1"); out = md.digest(data); if (startIdxInc != null && stopIdxExc != null) { out = Arrays.copyOfRange(out, startIdxInc, stopIdxExc); } return out; }
HashUtil { public static byte[] sha1sum(byte[] data, Integer startIdxInc, Integer stopIdxExc) throws NoSuchAlgorithmException { byte[] out; MessageDigest md; md = MessageDigest.getInstance("SHA-1"); out = md.digest(data); if (startIdxInc != null && stopIdxExc != null) { out = Arrays.copyOfRange(out, startIdxInc, stopIdxExc); } return out; } }
HashUtil { public static byte[] sha1sum(byte[] data, Integer startIdxInc, Integer stopIdxExc) throws NoSuchAlgorithmException { byte[] out; MessageDigest md; md = MessageDigest.getInstance("SHA-1"); out = md.digest(data); if (startIdxInc != null && stopIdxExc != null) { out = Arrays.copyOfRange(out, startIdxInc, stopIdxExc); } return out; }  }
HashUtil { public static byte[] sha1sum(byte[] data, Integer startIdxInc, Integer stopIdxExc) throws NoSuchAlgorithmException { byte[] out; MessageDigest md; md = MessageDigest.getInstance("SHA-1"); out = md.digest(data); if (startIdxInc != null && stopIdxExc != null) { out = Arrays.copyOfRange(out, startIdxInc, stopIdxExc); } return out; }  static byte[] sha1sum(byte[] data, Integer startIdxInc, Integer stopIdxExc); static byte[] sha1sum(String data); static byte[] sha1sum(byte[] data); static String sha1sumHex(byte[] data, Integer startIdxInc, Integer stopIdxExc); static String sha1sumHex(byte[] data); static String sha1sumHex(String data); }
HashUtil { public static byte[] sha1sum(byte[] data, Integer startIdxInc, Integer stopIdxExc) throws NoSuchAlgorithmException { byte[] out; MessageDigest md; md = MessageDigest.getInstance("SHA-1"); out = md.digest(data); if (startIdxInc != null && stopIdxExc != null) { out = Arrays.copyOfRange(out, startIdxInc, stopIdxExc); } return out; }  static byte[] sha1sum(byte[] data, Integer startIdxInc, Integer stopIdxExc); static byte[] sha1sum(String data); static byte[] sha1sum(byte[] data); static String sha1sumHex(byte[] data, Integer startIdxInc, Integer stopIdxExc); static String sha1sumHex(byte[] data); static String sha1sumHex(String data);  }