sha1 algorithm taken from public domain