ByteArray.st
changeset 15625 090e438cffe5
parent 15330 6e9281a08730
child 16620 9db0a09c71c0
child 18084 ab5b38bd8f81
equal deleted inserted replaced
15624:11ce1e9cf098 15625:090e438cffe5
   188 
   188 
   189 bitXor:aByteArray
   189 bitXor:aByteArray
   190     "return a new byteArray containing the bitWise-xor of the receiver's and the
   190     "return a new byteArray containing the bitWise-xor of the receiver's and the
   191      argument's bytes"
   191      argument's bytes"
   192 
   192 
   193     |answer|
   193     |size size1|
   194 
   194 
   195     answer := self copy.
   195     "size := self size min:aByteArray size"
   196     1 to: self size do: [ :each |
   196     size := self size.
   197 	answer at: each put: ((self at: each) bitXor: (aByteArray at: each))
   197     size1 := aByteArray size.
       
   198     size1 < size ifTrue:[
       
   199         size := size1.
   198     ].
   200     ].
   199     ^ answer
   201 
       
   202     ^ self copy
       
   203         bitXorBytesFrom:1 to:size with:aByteArray startingAt:1;
       
   204         yourself.
       
   205 
       
   206     "
       
   207         #[0 1 2 3 4] bitXor:#[0 1 2 3 4]
       
   208         #[0 1 2 3 4] bitXor:#[0 1 2 3]
       
   209     "
   200 ! !
   210 ! !
   201 
   211 
   202 !ByteArray methodsFor:'Compatibility-VW'!
   212 !ByteArray methodsFor:'Compatibility-VW'!
   203 
   213 
   204 asByteString
   214 asByteString
  3015 ! !
  3025 ! !
  3016 
  3026 
  3017 !ByteArray class methodsFor:'documentation'!
  3027 !ByteArray class methodsFor:'documentation'!
  3018 
  3028 
  3019 version
  3029 version
  3020     ^ '$Header: /cvs/stx/stx/libbasic/ByteArray.st,v 1.210 2013-05-27 08:23:00 cg Exp $'
  3030     ^ '$Header: /cvs/stx/stx/libbasic/ByteArray.st,v 1.211 2013-08-12 10:09:48 stefan Exp $'
  3021 !
  3031 !
  3022 
  3032 
  3023 version_CVS
  3033 version_CVS
  3024     ^ '$Header: /cvs/stx/stx/libbasic/ByteArray.st,v 1.210 2013-05-27 08:23:00 cg Exp $'
  3034     ^ '$Header: /cvs/stx/stx/libbasic/ByteArray.st,v 1.211 2013-08-12 10:09:48 stefan Exp $'
  3025 ! !
  3035 ! !
  3026 
  3036