Today’s fun technical challenge is figuring out how to duplicate MySQL’s sha1() function in Java. You can use the Java MessageDigest class to create a SHA-1 hash of a string, but the MySQL version encodes the string as a hexadecimal number, and there’s the rub. After a few fruitless Google searches, I’m turning to the MySQL source code …
Today’s fun technical challenge
Today’s fun technical challenge is figuring out how to duplicate MySQL’s sha1() function in Java. You can use the Java
MessageDigest
class to create a SHA-1 hash of a string, but the MySQL version encodes the string as a hexadecimal number, and there’s the rub. After a few fruitless Google searches, I’m turning to the MySQL source code …Commentary
Previous post
Thorny PakistanNext post
Josh Marshall’s analysis