Inserted hash function for random number generation.