encode the hash to be uri-compatible