Functions to encode and decode data for Mjolnir / merge of multiple functions from Hydra