Update util.py

Hash generation from string