I have one question. What is the "return "".join([chr(ord(secret_c) ^ ord(new_key_c)) for (secret_c,new_key_c) in zip(secret,new_key)]) " doing? Is this the actual implementation of xor?
@SanjinDedic2 жыл бұрын
Yes it is the implementation ord(secret_c )^ord(new_key_c) actually does the xor and returns an ineger value (which I keep representing in binary) the for loop simply cycles through the charcters in secret and the characters in message If I wrote that code myself in a way that is meant to be understood I would use 5 lines instead they used 2 variable for loops, list comprehensions and multiple operations all on one line
@adryelgainza16862 жыл бұрын
@@SanjinDedic Oh alright thank you!
@tonyitalia77982 жыл бұрын
Thank's you. Like this.
@SanjinDedic2 жыл бұрын
Happy to help! I thought that this code was too complicated for an easy challenge so I made this to explain it, hopefully the XOR stuff makes a bit more sense now