getMacAdresses() and toHexString() win/mac

Hi all,

I’m using machine ID for my copy protection stuff.
But i have strange results between windows/mac. (i am doing the test on an intel mac running osx and windows in a virtual machine).

let’s take a mac adresse : AB:CD:EF:AB:CD:EF
I then use getMacadresses to get the mac adresses as int64
when I watch the hex value i Have:
0xABCDEFABCDEF on windows

And when I use String::toHexString() i get:

I don’t understand cause this is the same intel machine so no matter of big/little endianess…

Any idea guys?



Interesting… Obviously both platforms have native methods, and it looks like they each use a different byte order.

Of course this never used to matter, because when I wrote that stuff, you couldn’t actually run a mac and pc on the same box, so nobody would ever have noticed that the numbers didn’t match!

Ideally, I’d change the mac version to swap its order, but that’d break software that unlocks based on the current order. What I might do instead is add a flag that lets you specify the endianness you want - that’d solve it without breaking existing code.

that’s what i finally did, swap the mac one to the right order.

thanks Jules!