This is a very inefficient way of dealing with hex, especially because `char` already has methods of testing and converting hex digits (see [`to_digit()`](http://doc.rust-lang.org/std/char/trait.Char.html#tymethod.to_digit))