Hi,
I've created a patch for MySQL 5.0.33 to provide a function SHA2().
Download it here:
http://www.karwin.com/sha2.patch.gz
It really just calls out to the OpenSSL library for the digest
functions. So you have to build MySQL from source with OpenSSL support
enabled.
You can use the function in SQL syntax like:
SELECT SHA2('message', 256);
The second argument is 224, 256, 384, or 512, depending on what digest
algorithm you want to use. If you pass 0 as the second argument, it
uses SHA-256.
This is my first code contribution to MySQL. I'd be grateful if someone
wants to review it and let me know if it needs any changes.
Regards,
Bill Karwin