Convert hash and unhash from to plain functions.