extract generate_hashphrase function