[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

aside: perl's unpack()



> > I can tell you an easier way to decipher them, but I too would like to
> > know how they are contructed, i.e what's the algorithm.
> 
> a.b.c.d
> 
> n = d + c * 256 + b * 256 ^ 2 + a * 256 ^ 3

after reading the previous mail, this is what i was thinking. i went to test
it in perl afterwards, but got the wrong result. could anyone tell me what's
wrong with my interpretation?

perl -le '$, = "."; print unpack("C4", "2704935062");'

cheers

-- 
Damien <bitwise@repose.cx>

Attachment: pgpmY6srpcTMT.pgp
Description: PGP signature


Reply to: