Added code to generate random hash