Forum Moderators: open

Message Too Old, No Replies

Javascript encryption

         

virtism

1:21 pm on Feb 8, 2009 (gmt 0)

10+ Year Member



Can anyone help in deciphering this ..

s2='';for(i=0;i< s.length;i++){s2+=String.fromCharCode(s.charCodeAt(i) ^ (i % 100));}document.write(s2)

I don't quite understand what is happening here

(s.charCodeAt(i) ^ (i % 100))

What is this ^ character doing ? can't find it in javascript operator list

Little_G

2:03 pm on Feb 8, 2009 (gmt 0)

10+ Year Member



Hi,

The ^ operator is "exclusive or" [en.wikipedia.org] it's a bitwise operator [developer.mozilla.org].

Andrew