String must be encoded before hashing.