in reply to Re^3: Encoding BCD
in thread Encoding BCD

I don't get it - aren't you just encoding it to Hex? That's not the same as BCD is it?

Replies are listed 'Best First'.
Re^5: Encoding BCD
by Corion (Patriarch) on Feb 28, 2009 at 08:32 UTC

    Packed Binary-coded decimals are a subset of hexadecimal numbers, except that their values are to be interpreted differently. But as we're encoding strings that have only decimal digits in them, just treating these decimal digits as hexadecimal digits results in the wanted packed bcd values. If you don't trust it, just look at that the tests return the wanted values.