implements sha1 hash algorithm