let rec hexToBits hex = if hex = "" then "" else hexCharToBits (String2.left_char hex) ^ hexToBits (String2.right_string hex)