UDFs and SPs for DB2 to generate and validate hashes