Add spec for postfix::hash and refactor it