The hex decoding is used as fallback when the input fails to locate an index in the buffer, not the other way around.
Added some examples for the lazy.