Update of /cvsroot/pymerase/pymerase/util
In directory sc8-pr-cvs1:/tmp/cvs-serv26520
Modified Files:
xor_string.py
Log Message:
Replace the array with a list of ords to make this code compatible
with jython.
Index: xor_string.py
===================================================================
RCS file: /cvsroot/pymerase/pymerase/util/xor_string.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** xor_string.py 15 Aug 2002 00:09:21 -0000 1.2
--- xor_string.py 11 Dec 2002 22:31:30 -0000 1.3
***************
*** 32,36 ****
#
- import array
import operator
--- 32,35 ----
***************
*** 40,57 ****
else:
length = len(s)
! tmp = array.array('B', s)
tmp = map(operator.xor, tmp, [val]*length)
return reduce(operator.add, map(chr, tmp))
-
-
-
-
-
-
-
-
-
-
-
-
-
--- 39,43 ----
else:
length = len(s)
! tmp = map(ord, s)
tmp = map(operator.xor, tmp, [val]*length)
return reduce(operator.add, map(chr, tmp))
|