summaryrefslogtreecommitdiffstats
path: root/GarbageProofOfConcept.py
diff options
context:
space:
mode:
authorMalfurious <m@lfurio.us>2021-08-28 09:45:57 -0400
committerMalfurious <m@lfurio.us>2021-08-28 10:01:42 -0400
commit7bd18b4b22f3a6bf86b131329345f9a75d8f699c (patch)
tree07f2ac0cb38a7424b711c2dd9b59116e2ed0848b /GarbageProofOfConcept.py
parent1522a21d24add0d78f7e4a5fae7654b709045754 (diff)
downloadSorensenCompression-7bd18b4b22f3a6bf86b131329345f9a75d8f699c.tar.gz
SorensenCompression-7bd18b4b22f3a6bf86b131329345f9a75d8f699c.zip
Commit Rust POC
This replaces the Python script. Since all MIT-licensed code is removed, the LICENSE file is as well. 'cargo run' to run the program. Signed-off-by: Malfurious <m@lfurio.us>
Diffstat (limited to '')
-rwxr-xr-xGarbageProofOfConcept.py46
1 files changed, 0 insertions, 46 deletions
diff --git a/GarbageProofOfConcept.py b/GarbageProofOfConcept.py
deleted file mode 100755
index e6e4030..0000000
--- a/GarbageProofOfConcept.py
+++ /dev/null
@@ -1,46 +0,0 @@
-#!/usr/bin/env python
-
-import hashlib
-from itertools import combinations
-
-data = b"abc"
-length = len(data)
-
-hexdigest = hashlib.sha256(data).hexdigest()
-print(hexdigest)
-
-lookupTable = [0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3,
- 4, 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, 1, 2, 2, 3, 2,
- 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4,
- 5, 4, 5, 5, 6, 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, 2,
- 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 2, 3, 3, 4, 3, 4, 4,
- 5, 3, 4, 4, 5, 4, 5, 5, 6, 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5,
- 6, 6, 7, 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, 2, 3, 3,
- 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 2, 3, 3, 4, 3, 4, 4, 5, 3,
- 4, 4, 5, 4, 5, 5, 6, 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6,
- 7, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 3, 4, 4, 5, 4,
- 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5,
- 6, 5, 6, 6, 7, 4, 5, 5, 6, 5, 6, 6, 7, 5, 6, 6, 7, 6, 7, 7, 8]
-
-sum1 = 0
-for i in range(length):
- sum1 += lookupTable[bytearray(data)[i]]
-
-print("The length is: {0}".format(length))
-print("The ones count is: {0}".format(sum1))
-
-combinations = list(combinations(range(length * 8),sum1))
-numCombs = len(combinations)
-
-count = 1
-for comb in combinations:
- print("Trying {0}/{1}".format(count, numCombs))
- count += 1
- a = [0] * length
- for bit in comb:
- a[bit//8] |= 1 << (bit % 8)
- if hashlib.sha256(bytearray(a)).hexdigest() == hexdigest:
- print("Found! {0}".format(a))
- break
-else:
- print("failed to find")