about summary refs log tree commit diff
path: root/tvix/derivation/src/nix_hash.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tvix/derivation/src/nix_hash.rs')
-rw-r--r--tvix/derivation/src/nix_hash.rs15
1 files changed, 0 insertions, 15 deletions
diff --git a/tvix/derivation/src/nix_hash.rs b/tvix/derivation/src/nix_hash.rs
deleted file mode 100644
index a49d444faa53..000000000000
--- a/tvix/derivation/src/nix_hash.rs
+++ /dev/null
@@ -1,15 +0,0 @@
-/// CompressHash takes an arbitrary long sequence of bytes (usually a hash
-/// digest), and returns a sequence of bytes of length output_size.
-/// It's calculated by rotating through the bytes in the output buffer (zero-
-/// initialized), and XOR'ing with each byte of the passed input.
-/// It consumes 1 byte at a time, and XOR's it with the current value in the
-/// output buffer.
-pub fn compress_hash(input: &[u8], output_size: usize) -> Vec<u8> {
-    let mut output: Vec<u8> = vec![0; output_size];
-
-    for (ii, ch) in input.iter().enumerate() {
-        output[ii % output_size] ^= ch;
-    }
-
-    output
-}