/** Sets the digest value from a hex string. */ public void setDigest(String hex) { if (hex.length() != MD5_LEN*2) throw new IllegalArgumentException("Wrong length: " + hex.length()); byte[] digest = new byte[MD5_LEN]; for (int i = 0; i < MD5_LEN; i++) { int j = i << 1; digest[i] = (byte)(charToNibble(hex.charAt(j)) << 4 | charToNibble(hex.charAt(j+1))); } this.digest = digest; }
/** Sets the digest value from a hex string. */ public void setDigest(String hex) { if (hex.length() != MD5_LEN*2) throw new IllegalArgumentException("Wrong length: " + hex.length()); byte[] digest = new byte[MD5_LEN]; for (int i = 0; i < MD5_LEN; i++) { int j = i << 1; digest[i] = (byte)(charToNibble(hex.charAt(j)) << 4 | charToNibble(hex.charAt(j+1))); } this.digest = digest; }
/** Sets the digest value from a hex string. */ public void setDigest(String hex) { if (hex.length() != MD5_LEN*2) throw new IllegalArgumentException("Wrong length: " + hex.length()); byte[] digest = new byte[MD5_LEN]; for (int i = 0; i < MD5_LEN; i++) { int j = i << 1; digest[i] = (byte)(charToNibble(hex.charAt(j)) << 4 | charToNibble(hex.charAt(j+1))); } this.digest = digest; }
/** Sets the digest value from a hex string. */ public void setDigest(String hex) { if (hex.length() != MD5_LEN*2) throw new IllegalArgumentException("Wrong length: " + hex.length()); byte[] digest = new byte[MD5_LEN]; for (int i = 0; i < MD5_LEN; i++) { int j = i << 1; digest[i] = (byte)(charToNibble(hex.charAt(j)) << 4 | charToNibble(hex.charAt(j+1))); } this.digest = digest; }
/** Sets the digest value from a hex string. */ public void setDigest(String hex) { if (hex.length() != MD5_LEN*2) throw new IllegalArgumentException("Wrong length: " + hex.length()); byte[] digest = new byte[MD5_LEN]; for (int i = 0; i < MD5_LEN; i++) { int j = i << 1; digest[i] = (byte)(charToNibble(hex.charAt(j)) << 4 | charToNibble(hex.charAt(j+1))); } this.digest = digest; }
/** Sets the digest value from a hex string. */ public void setDigest(String hex) { if (hex.length() != MD5_LEN*2) throw new IllegalArgumentException("Wrong length: " + hex.length()); byte[] digest = new byte[MD5_LEN]; for (int i = 0; i < MD5_LEN; i++) { int j = i << 1; digest[i] = (byte)(charToNibble(hex.charAt(j)) << 4 | charToNibble(hex.charAt(j+1))); } this.digest = digest; }
/** Sets the digest value from a hex string. */ public void setDigest(String hex) { if (hex.length() != MD5_LEN*2) throw new IllegalArgumentException("Wrong length: " + hex.length()); byte[] digest = new byte[MD5_LEN]; for (int i = 0; i < MD5_LEN; i++) { int j = i << 1; digest[i] = (byte)(charToNibble(hex.charAt(j)) << 4 | charToNibble(hex.charAt(j+1))); } this.digest = digest; }