WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit b79f84d

Browse files
authored
digest: tweak CollisionResistance docs (#2044)
1 parent 06e4e1a commit b79f84d

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

digest/src/lib.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -293,9 +293,11 @@ pub trait VarOutputCustomized: Sized {
293293

294294
/// Types with a certain collision resistance.
295295
pub trait CollisionResistance {
296-
/// Collision resistance in bytes. This applies to an output size of `CollisionResistance * 2`.
297-
/// The collision resistance with a smaller output size is not defined by this trait and is at
298-
/// least the given collision resistance with a bigger output.
296+
/// Collision resistance in bytes.
297+
///
298+
/// This applies to an output size of at least `2 * CollisionResistance` bytes.
299+
/// For a smaller output size collision resistance can be usually calculated as
300+
/// `min(CollisionResistance, OutputSize / 2)`.
299301
type CollisionResistance: Unsigned;
300302
}
301303

0 commit comments

Comments
 (0)