Added SHA1 hashing function
attributed code to bodinegl, and removed lots of comments to make more compact