change hash to encode