I just need a way to convert a hex number (6 bytes) to a integer representation (15 digits)
You need to get off the "6 bytes" crap. You have a 12 character hex representation of a value that you want to to convert to a integral data type. Converting each character to a byte, in the range 0 to 15, and bit shifting, with the appropriate casts, storing the result in the proper type (NOT long; you must use long long), will get you the integral value you are looking for.