From 8ce1155a1eb490625a7e949a10c4283b4b773d30 Mon Sep 17 00:00:00 2001 From: Kim Altintop Date: Thu, 13 Apr 2023 16:50:24 +0200 Subject: core: replace bundle checksum with BLAKE3 BLAKE3 has a verified streaming mode (Bao), which allows variable chunk sizes without altering the root hash. This means that a BLAKE3 hash can serve as a long-term stable content address in location-independent storage (as demonstrated by iroh). Signed-off-by: Kim Altintop --- src/io.rs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'src/io.rs') diff --git a/src/io.rs b/src/io.rs index 86f91c6..324d12c 100644 --- a/src/io.rs +++ b/src/io.rs @@ -1,10 +1,7 @@ // Copyright © 2022 Kim Altintop // SPDX-License-Identifier: GPL-2.0-only WITH openvpn-openssl-exception -use sha2::{ - digest::generic_array::GenericArray, - Digest, -}; +use digest::Digest; /// Created by [`Lines::until_blank`], stops iteration at the first blank line. pub struct UntilBlank { @@ -94,8 +91,8 @@ impl HashWriter where D: Digest, { - pub fn hash(self) -> GenericArray { - self.hasher.finalize() + pub fn hasher(&self) -> &D { + &self.hasher } } -- cgit v1.2.3