On 2005-10-10, Larry Bates <[EMAIL PROTECTED]> wrote: >> I am trying to xor the byte representation of every char in a string with >> its predecessor. But I don't know how to convert a char into its byte >> representation. This is to calculate the nmea checksum for gps data.
> ord(c) gives you decimal representation of a character. While ord(c) is what the OP needs, it doesn't give a decimal represention -- which I guess would be a string like "65" for the ASCII characer "A". What ord() gives you is an integer object with the value of the character [which the hardware stores in binary on all of the platforms I'm aware of]. -- Grant Edwards grante Yow! Hmmm... A hash-singer at and a cross-eyed guy were visi.com SLEEPING on a deserted island, when... -- http://mail.python.org/mailman/listinfo/python-list