Java String to SHA1

UPDATEYou can use Apache Commons Codec (version 1.7+) to do this job for you. DigestUtils.sha1Hex(stringToConvertToSHexRepresentation) Thanks to @Jon Onstott for this suggestion. Old Convert your Byte Array to Hex String. Real’s How To tells you how. return byteArrayToHexString(md.digest(convertme)) and (copied from Real’s How To) public static String byteArrayToHexString(byte[] b) { String result = “”; for (int i=0; i < … Read more