diff --git a/CHANGELOG.md b/CHANGELOG.md index cbd70d80..f194ee51 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,9 +1,60 @@ +## [](https://github.com/multiformats/rust-multihash/compare/v0.18.0...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](https://github.com/multiformats/rust-multihash/issues/289)) ([8473e2f](https://github.com/multiformats/rust-multihash/commit/8473e2f7ecdc0838a3f35d0ecb1935b4c70797c2)) +* Serde serialize Multihash in bytes representation ([#302](https://github.com/multiformats/rust-multihash/issues/302)) ([1023226](https://github.com/multiformats/rust-multihash/commit/10232266c01aa83190af62ad6aeebf63bb7a16c7)) + + +### Bug Fixes + +* avoid possible panic in error handling code ([#277](https://github.com/multiformats/rust-multihash/issues/277)) ([5dc1dfa](https://github.com/multiformats/rust-multihash/commit/5dc1dfac0235e63e9ad80572e6b73f8fcd301ec3)) +* don't panic on non minimal varints ([#291](https://github.com/multiformats/rust-multihash/issues/291)) ([6ef6040](https://github.com/multiformats/rust-multihash/commit/6ef604012b84d5c15d4f3c66a28ead96afedf158)), closes [#282](https://github.com/multiformats/rust-multihash/issues/282) +* expose `MultihashDigest` trait in codetable ([#304](https://github.com/multiformats/rust-multihash/issues/304)) ([50b43cd](https://github.com/multiformats/rust-multihash/commit/50b43cdbba5492923ffb31bb197930d2f3e2cf14)) + + +### Code Refactoring + +* split crates into multiple to isolate breaking changes ([#272](https://github.com/multiformats/rust-multihash/issues/272)) ([954e523](https://github.com/multiformats/rust-multihash/commit/954e5233d273a2b7d682fd087178203628d131a4)) + ### Migrating When upgrading to `v0.19`, consider the following: -- `Code` has moved to `multihash_codetable::Code`. - Either use that or define your own codetable using `multihash_derive`. +- `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](codetable/examples/custom_table.rs) on how to use it. For the simplest migration, use the `multihash_codetable::Code`. + + **Before** + + ```rust + use multihash::{Code, MultihashDigest}; + + fn main() { + let hash = Code::Sha2_256.digest(b"hello, world!"); + println!("{:?}", hash); + } + ``` + + **After** + + ```rust + 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: @@ -13,7 +64,33 @@ When upgrading to `v0.19`, consider the following: ``` - The `identity` hasher has been removed completely. - Check the [identity example](examples/identity.rs) on how to replicate the functionality. + + **Before** + + ```rust + use multihash::{Code, MultihashDigest}; + + fn main() { + let hash = Code::Identity.digest(b"hello, world!"); + println!("{:?}", hash); + } + ``` + + **After** + + ```rust + 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](examples/identity.rs) for more information on how to replicate the functionality. + ## [v0.18.1](https://github.com/multiformats/rust-multihash/compare/v0.18.0...v0.18.1) (2023-04-14) diff --git a/Cargo.toml b/Cargo.toml index 8c67a2cd..2d449f35 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,7 +7,7 @@ name = "multihash" description = "Implementation of the multihash format" repository = "https://github.com/multiformats/rust-multihash" keywords = ["multihash", "ipfs"] -version = "0.18.0" +version = "0.19.0" authors = ["dignifiedquire ", "David Craven ", "Volker Mische "] license = "MIT" readme = "README.md" diff --git a/RELEASE.md b/RELEASE.md index c0d44ba7..43de960a 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -24,9 +24,13 @@ becomes: # [v0.18.0](https://github.com/multiformats/rust-multihash/compare/v0.17.0...v0.18.0) (2022-12-06) ``` -## Publishing +Create a pull request with the changelog changes and the correct version bumps to the crates. -Publishing on crates.io, bumping version & generating tags is done using [`cargo-release`](https://github.com/crate-ci/cargo-release). + +Publishing +---------- + +Once the PR above is merged, the crate can be published. This is done using [`cargo-release`](https://github.com/crate-ci/cargo-release). This requires the following permissions @@ -39,11 +43,11 @@ This requires the following permissions Dry run ```sh -$ cargo release +$ cargo release --workspace ``` Actual publishing ```sh -$ cargo release --execute +$ cargo release --workspace --execute ``` diff --git a/codetable/Cargo.toml b/codetable/Cargo.toml index 1b9c552d..674e03b3 100644 --- a/codetable/Cargo.toml +++ b/codetable/Cargo.toml @@ -26,7 +26,7 @@ sha2 = { version = "0.10.0", default-features = false, optional = true } sha3 = { version = "0.10.0", default-features = false, optional = true } strobe-rs = { version = "0.8.1", default-features = false, optional = true } ripemd = { version = "0.1.1", default-features = false, optional = true } -multihash-derive = { version = "0.8.0", path = "../derive", default-features = false } +multihash-derive = { version = "0.9.0", path = "../derive", default-features = false } core2 = { version = "0.4.0", default-features = false } serde = { version = "1.0.158", features = ["derive"], optional = true } diff --git a/derive/Cargo.toml b/derive/Cargo.toml index df4a2ad7..98aa94bd 100644 --- a/derive/Cargo.toml +++ b/derive/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "multihash-derive" -version = "0.8.1" +version = "0.9.0" edition = "2018" description = "Proc macro for deriving custom multihash tables." license = "MIT" @@ -12,7 +12,7 @@ std = ["multihash/std", "core2/std"] [dependencies] multihash-derive-impl = { version = "0.1.0", path = "../derive-impl" } -multihash = { version = "0.18.0", path = "../", default-features = false } +multihash = { version = "0.19.0", path = "../", default-features = false } core2 = { version = "0.4.0", default-features = false } [dev-dependencies]