Skip to content

Commit

Permalink
chore: expose hashed_bytes of KBucketKey
Browse files Browse the repository at this point in the history
  • Loading branch information
maqi committed Oct 24, 2023
1 parent 26e2d50 commit 7d0a02a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions protocols/kad/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
See [PR 4659](https://github.com/libp2p/rust-libp2p/pull/4659).
- Emit `ModeChanged` event whenever we automatically reconfigure the mode.
See [PR 4503](https://github.com/libp2p/rust-libp2p/pull/4503).
- Expose hashed bytes of KBucketKey.
See [PR 4698](https://github.com/libp2p/rust-libp2p/pull/4698).

## 0.44.6

Expand Down
5 changes: 5 additions & 0 deletions protocols/kad/src/kbucket/key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,11 @@ impl<T> Key<T> {
self.bytes.distance(other)
}

/// Exposing the hashed bytes.
pub fn hashed_bytes(&self) -> &[u8] {
&self.bytes.0
}

/// Returns the uniquely determined key with the given distance to `self`.
///
/// This implements the following equivalence:
Expand Down

0 comments on commit 7d0a02a

Please sign in to comment.