Skip to content

Latest commit

 

History

History
146 lines (88 loc) · 5.61 KB

CHANGELOG.md

File metadata and controls

146 lines (88 loc) · 5.61 KB

(2023-10-23)

Dependency Updates

  • multihash 0.19.2
    • update unsigned-varint
  • codetable 0.1.4
    • update strobe
  • multihash-derive 0.9.1
    • update multihash-derive-impl
  • multihash-derive-impl 0.9.1
    • remove proc-macro-error dependency
    • update synstructure
    • update syn to v2

(2023-09-06)

Bug Fixes

  • make Serde (de)serialization no_std compatible (#337) (7ad5161), closes 336#. This was a regression introduced in v0.19.0.

(2023-06-06)

⚠ BREAKING CHANGES

  • the Serde serialization format changed
  • split crates into multiple to isolate breaking changes
  • identity hasher was removed

See the migration section below for help on upgrading.

Features

  • codetable: remove identity hasher (#289) (8473e2f)
  • Serde serialize Multihash in bytes representation (#302) (1023226)

Bug Fixes

  • avoid possible panic in error handling code (#277) (5dc1dfa)
  • don't panic on non minimal varints (#291) (6ef6040), closes #282
  • expose MultihashDigest trait in codetable (#304) (50b43cd)

Code Refactoring

  • split crates into multiple to isolate breaking changes (#272) (954e523)

Migrating

When upgrading to v0.19, consider the following:

  • Code has moved from multihash::Code to multihash_codetable::Code. It's strongly recommended to define your own code table using multihash_derive. Check the custom codetable example on how to use it. For the simplest migration, use the multihash_codetable::Code.

    Before

    use multihash::{Code, MultihashDigest};
    
    fn main() {
        let hash = Code::Sha2_256.digest(b"hello, world!");
        println!("{:?}", hash);
    }

    After

    use multihash_codetable::{Code, MultihashDigest};
    
    fn main() {
        let hash = Code::Sha2_256.digest(b"hello, world!");
        println!("{:?}", hash);
    }

    If you get compile errors, make sure you have the correct features enabled. In this case it would be the sha2 and digest features.

  • multihash::Multihash now requires the size of its internal buffer as a const-generic. You can migrate your existing code by defining the following type-alias:

    type Multihash = multihash::Multihash<64>;
  • The identity hasher has been removed completely.

    Before

    use multihash::{Code, MultihashDigest};
    
    fn main() {
        let hash = Code::Identity.digest(b"hello, world!");
        println!("{:?}", hash);
    }

    After

    use multihash::Multihash;
    
    const IDENTITY_HASH_CODE: u64 = 0x00;
    
    fn main() {
        let hash = Multihash::<64>::wrap(IDENTITY_HASH_CODE, b"hello, world!").unwrap();
        println!("{:?}", hash);
    }

    Check the identity example for more information on how to replicate the functionality.

v0.18.1 (2023-04-14)

Bug Fixes

0.18.0 (2022-12-06)

⚠ BREAKING CHANGES

  • update to Rust edition 2021

  • Multihash::write() returns bytes written

    Prior to this change it returned an empty tuple (), now it returns the bytes written.

Features

Bug Fixes