Revert "Revert "Changed hash function from md5 to sha1""

This reverts commit ad5e72845b50436fc7fd70a13cb181192cb8d6f8.
Fixed sha1 bug