Adding parameter HASH_TEXT.
Fixing logic mistake in calculating SHA1 hashes.