Added the random_sha1 generator function and replaced the use of uuid with the hash.