From df59764861742648ccc1dd27388cd95703d3080a Mon Sep 17 00:00:00 2001 From: root Date: Wed, 9 Jul 2025 16:07:39 +0200 Subject: changed folder structure & deleted useless files --- logical_operators/xor.py | 23 ----------------------- 1 file changed, 23 deletions(-) delete mode 100644 logical_operators/xor.py (limited to 'logical_operators/xor.py') diff --git a/logical_operators/xor.py b/logical_operators/xor.py deleted file mode 100644 index 17bd630..0000000 --- a/logical_operators/xor.py +++ /dev/null @@ -1,23 +0,0 @@ -from sys import argv -""" -0 + 0 -> 1 -1 + 1 -> 1 -0 + 1 -> 0 -1 + 0 -> 0 -""" -# Read two files as byte arrays -file1_b = bytearray(open(argv[1], 'rb').read()) -file2_b = bytearray(open(argv[2], 'rb').read()) - -# Set the length to be the smaller one -size = min(len(file1_b), len(file2_b)) -xord_byte_array = bytearray(size) - -# XOR between the files -for i in range(size): - xord_byte_array[i] = file1_b[i] ^ file2_b[i] - -# Write the XORd bytes to the output file -open(argv[3], 'wb').write(xord_byte_array) - -print(f'[*] {argv[1]} XOR {argv[2]}\n[*] Saved to \033[1;33m{argv[3]}\033[1;m.') \ No newline at end of file -- cgit v1.2.3