Re: XOR on string

2005-01-27 Thread Nick Craig-Wood
Peter Hansen <[EMAIL PROTECTED]> wrote: > snacktime wrote: > > I need to calculate the lrc of a string using an exclusive or on each > > byte in the string. How would I do this in python? > > lrc == Linear Redundancy Check? or Longitudinal? Note that > such terms are not precisely defined...

Re: XOR on string

2005-01-26 Thread snacktime
> lrc == Linear Redundancy Check? or Longitudinal? Note that > such terms are not precisely defined... generally just acronyms > people make up and stick in their user manuals for stuff. :-) > Longitudinal > import operator > lrc = reduce(operator.xor, [ord(c) for c in string]) That's better t

Re: XOR on string

2005-01-26 Thread Peter Hansen
snacktime wrote: I need to calculate the lrc of a string using an exclusive or on each byte in the string. How would I do this in python? lrc == Linear Redundancy Check? or Longitudinal? Note that such terms are not precisely defined... generally just acronyms people make up and stick in their u

XOR on string

2005-01-26 Thread snacktime
I need to calculate the lrc of a string using an exclusive or on each byte in the string. How would I do this in python? Chris -- http://mail.python.org/mailman/listinfo/python-list