Extract some methods in HashingKeyBuilder

This makes it easy to override the preparation method of the string
pre-hashing.