From 205cb962fcc99814caac8e1b9d4f8ffd956eb184 Mon Sep 17 00:00:00 2001 From: Jordan Santell Date: Mon, 22 May 2023 11:03:56 -0700 Subject: [PATCH] feat!: Migrate default hashing from blake2b to blake3. (#85) --- ucan/src/store.rs | 2 +- ucan/src/ucan.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ucan/src/store.rs b/ucan/src/store.rs index fde943fd..034a4c32 100644 --- a/ucan/src/store.rs +++ b/ucan/src/store.rs @@ -120,7 +120,7 @@ impl UcanStore for MemoryStore { ) -> Result { let codec = RawCodec; let block = codec.encode(&token)?; - let cid = Cid::new_v1(codec.into(), Code::Blake2b256.digest(&block)); + let cid = Cid::new_v1(codec.into(), Code::Blake3_256.digest(&block)); let mut dags = self.dags.lock().map_err(|_| anyhow!("poisoned mutex!"))?; dags.insert(cid, block); diff --git a/ucan/src/ucan.rs b/ucan/src/ucan.rs index 6bd616f7..bd0006d1 100644 --- a/ucan/src/ucan.rs +++ b/ucan/src/ucan.rs @@ -190,7 +190,7 @@ impl TryFrom<&Ucan> for Cid { let token = value.encode()?; let encoded = codec.encode(token.as_bytes())?; - Ok(Cid::new_v1(codec.into(), Code::Blake2b256.digest(&encoded))) + Ok(Cid::new_v1(codec.into(), Code::Blake3_256.digest(&encoded))) } }