Let’s play now with Hexadecimal strings.

1

Straightforward solution using xxd tool:

2

Only one tiny trick here. When working with echo at the shell, consider escaping those characters that have special meanings for the shell process. It can play a bad hand.