Encodes and Decodes key-value hashes.