Functions for encoding and decoding data in Mjolnir / merge of multiple functions from Hydra