Since I stumbled upon this in my own search and did not find what I was looking for, here is what I ended up using to parse a hexadecimal number that can be applied to any known character set
letters := 0 1 2 3 4 5 6 7 8 9 abcdef nextletter = $(strip $(foreach v,$(letters),$(word 2,$(filter $(1)$(v)%,$(2)) $v)))
then
INPUT := 40b3 firstletter := $(call nextletter,,$(INPUT)) secondletter := $(call nextletter,$(firstletter),$(INPUT)) thirdletter := $(call nextletter,$(firstletter)$(secondletter),$(INPUT))
and etc.
It is ugly, but it is not agnostic.
source share