Skip to content

Commit

Permalink
feat!: Migrate default hashing from blake2b to blake3. (#85)
Browse files Browse the repository at this point in the history
  • Loading branch information
jsantell authored May 22, 2023
1 parent 67ec64d commit 205cb96
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ucan/src/store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ impl UcanStore<RawCodec> for MemoryStore {
) -> Result<Cid> {
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);
Expand Down
2 changes: 1 addition & 1 deletion ucan/src/ucan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)))
}
}

Expand Down

0 comments on commit 205cb96

Please sign in to comment.