packed BCD isn't hex.
> On Thu Nov 27 2014 at 12:08:40 PM <
di3go.b...@gmail.com> wrote:
>>
>> hi guys!
>> I need to implement a tracker protocol and in one of the field i have to
>> do this:
>>
>> The id is made up of numerical digits and is encoded in this field as
>> packed BCD. The most significant digit is placed in the upper four bits of
>> the first byte. In the case where an odd number of digits are used, a 0x0F
>> is used to pad the lower 4 bits of the last byte.
>>
>> How can i parse this []byte to a string in golang?
Are you sure you want to parse it to a string and not, say, an int64?
You just pick the bytes apart into 4-bit chunks and do a shift-and-add
to build up a number.