add hex encode/decode support