Refactored HashTransformer