diff options
author | Malfurious <m@lfurio.us> | 2021-11-25 01:16:18 -0500 |
---|---|---|
committer | Malfurious <m@lfurio.us> | 2021-11-25 01:16:18 -0500 |
commit | 30686a8e693f2d61bda933d1370b6ea50b8bf0a6 (patch) | |
tree | 91f3ed277465f1a7426acea31c7074faf1d1a32f | |
parent | 16ac36edf6250e1b8f414adec0fccccf5770c247 (diff) | |
download | SorensenCompression-30686a8e693f2d61bda933d1370b6ea50b8bf0a6.tar.gz SorensenCompression-30686a8e693f2d61bda933d1370b6ea50b8bf0a6.zip |
Remove redundant rust code
This logic has already been reimplemented in C, or is otherwise
unneeded.
Signed-off-by: Malfurious <m@lfurio.us>
-rw-r--r-- | Cargo.lock | 180 | ||||
-rw-r--r-- | Cargo.toml | 12 | ||||
-rw-r--r-- | data.bin | 1 | ||||
-rw-r--r-- | src/iter.rs | 10 | ||||
-rw-r--r-- | src/load_file.rs | 12 | ||||
-rw-r--r-- | src/main.rs | 31 |
6 files changed, 0 insertions, 246 deletions
diff --git a/Cargo.lock b/Cargo.lock deleted file mode 100644 index d85fb8d..0000000 --- a/Cargo.lock +++ /dev/null @@ -1,180 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -[[package]] -name = "autocfg" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8aac770f1885fd7e387acedd76065302551364496e46b3dd00860b2f8359b9d" - -[[package]] -name = "block-buffer" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0940dc441f31689269e10ac70eb1002a3a1d3ad1390e030043662eb7fe4688b" -dependencies = [ - "block-padding", - "byte-tools", - "byteorder", - "generic-array", -] - -[[package]] -name = "block-padding" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa79dedbb091f449f1f39e53edf88d5dbe95f895dae6135a8d7b881fb5af73f5" -dependencies = [ - "byte-tools", -] - -[[package]] -name = "byte-tools" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7" - -[[package]] -name = "byteorder" -version = "1.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08c48aae112d48ed9f069b33538ea9e3e90aa263cfa3d1c24309612b1f7472de" - -[[package]] -name = "digest" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3d0c8c8752312f9713efd397ff63acb9f85585afbf179282e720e7704954dd5" -dependencies = [ - "generic-array", -] - -[[package]] -name = "fake-simd" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed" - -[[package]] -name = "generic-array" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c68f0274ae0e023facc3c97b2e00f076be70e254bc851d972503b328db79b2ec" -dependencies = [ - "typenum", -] - -[[package]] -name = "hex" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "805026a5d0141ffc30abb3be3173848ad46a1b1664fe632428479619a3644d77" - -[[package]] -name = "num" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8536030f9fea7127f841b45bb6243b27255787fb4eb83958aa1ef9d2fdc0c36" -dependencies = [ - "num-bigint", - "num-complex", - "num-integer", - "num-iter", - "num-rational", - "num-traits", -] - -[[package]] -name = "num-bigint" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "090c7f9998ee0ff65aa5b723e4009f7b217707f1fb5ea551329cc4d6231fb304" -dependencies = [ - "autocfg", - "num-integer", - "num-traits", -] - -[[package]] -name = "num-complex" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6b19411a9719e753aff12e5187b74d60d3dc449ec3f4dc21e3989c3f554bc95" -dependencies = [ - "autocfg", - "num-traits", -] - -[[package]] -name = "num-integer" -version = "0.1.42" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f6ea62e9d81a77cd3ee9a2a5b9b609447857f3d358704331e4ef39eb247fcba" -dependencies = [ - "autocfg", - "num-traits", -] - -[[package]] -name = "num-iter" -version = "0.1.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfb0800a0291891dd9f4fe7bd9c19384f98f7fbe0cd0f39a2c6b88b9868bbc00" -dependencies = [ - "autocfg", - "num-integer", - "num-traits", -] - -[[package]] -name = "num-rational" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c000134b5dbf44adc5cb772486d335293351644b801551abe8f75c84cfa4aef" -dependencies = [ - "autocfg", - "num-bigint", - "num-integer", - "num-traits", -] - -[[package]] -name = "num-traits" -version = "0.2.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c62be47e61d1842b9170f0fdeec8eba98e60e90e5446449a0545e5152acd7096" -dependencies = [ - "autocfg", -] - -[[package]] -name = "opaque-debug" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2839e79665f131bdb5782e51f2c6c9599c133c6098982a54c794358bf432529c" - -[[package]] -name = "pszip" -version = "0.1.0" -dependencies = [ - "hex", - "num", - "sha2", -] - -[[package]] -name = "sha2" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27044adfd2e1f077f649f59deb9490d3941d674002f7d062870a60ebe9bd47a0" -dependencies = [ - "block-buffer", - "digest", - "fake-simd", - "opaque-debug", -] - -[[package]] -name = "typenum" -version = "1.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "373c8a200f9e67a0c95e62a4f52fbf80c23b4381c05a17845531982fa99e6b33" diff --git a/Cargo.toml b/Cargo.toml deleted file mode 100644 index 679c3b3..0000000 --- a/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "pszip" -version = "0.1.0" -authors = ["malf"] -edition = "2018" - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - -[dependencies] -sha2 = "0.8.1" -num = "*" -hex = "0.3.1" diff --git a/data.bin b/data.bin deleted file mode 100644 index f2ba8f8..0000000 --- a/data.bin +++ /dev/null @@ -1 +0,0 @@ -abc
\ No newline at end of file diff --git a/src/iter.rs b/src/iter.rs deleted file mode 100644 index f8aa6cb..0000000 --- a/src/iter.rs +++ /dev/null @@ -1,10 +0,0 @@ -use num::BigInt; - -pub fn next(v: &BigInt) -> BigInt -{ - /*let t: BigUint = v | (v - 1); - (t + 1) | (((!t & -!t) - 1) >> (v.trailing_zeros() + 1))*/ - - let t: BigInt = (v | (v - 1u32)) + 1u32; - &t | ((((&t & -&t) / (v & -v)) >> 1) - 1u32) -} diff --git a/src/load_file.rs b/src/load_file.rs deleted file mode 100644 index 0fd1541..0000000 --- a/src/load_file.rs +++ /dev/null @@ -1,12 +0,0 @@ -use std::fs::File; -use std::io::Read; - -pub fn load_file_vec(path: &String) -> std::io::Result<Vec<u8>> -{ - let mut file = File::open(path)?; - let mut data = Vec::new(); - - file.read_to_end(&mut data)?; - - Ok(data) -} diff --git a/src/main.rs b/src/main.rs index bfed16b..5197cbe 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,34 +1,3 @@ -mod iter; -mod load_file; -mod demo_hash; - -use num::BigInt; -use num::bigint::Sign; - -fn vec_pop_cnt(v: &Vec<u8>) -> u32 -{ - let mut cnt = 0; - - for x in v - { - cnt += x.count_ones(); - } - - cnt -} - -fn pop_cnt_vec(c: u32) -> Vec<u8> -{ - let mut v = Vec::new(); - v.push(2u8.pow(c % 8) - 1); - for _ in 0..(c / 8) - { - v.push(0xff); - } - - v -} - fn main() { /* "Compression" setup */ |