What changed, and why it matters
This commit only changes the wording of code comments (documentation) from singular verbs like 'Finalize' to plural verbs like 'Finalizes' to match the project's style convention. No actual program code was modified, so it cannot affect security or behavior.
No action required; this is a documentation-style-only change with no security relevance.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff consists entirely of doc-comment edits in the rust-bitcoin hashes crate. Every change is a single-word substitution in a Rust doc comment (e.g., ‘Finalize’ -> ‘Finalizes’, ‘Drain’ -> ‘Drains’, ‘Iterate’ -> ‘Iterates’). No executable code, type signatures, logic, or public API surface changed.
Changed components
hashes/src/hash160/mod.rshashes/src/lib.rshashes/src/ripemd160/mod.rshashes/src/sha1/mod.rshashes/src/sha256/mod.rshashes/src/sha256d/mod.rshashes/src/sha384/mod.rshashes/src/sha512/mod.rshashes/src/sha512_256/mod.rsInspect captured patch +13 / −13
diff --git a/hashes/src/hash160/mod.rs b/hashes/src/hash160/mod.rs
index f4996abe..94ce4e32 100644
--- a/hashes/src/hash160/mod.rs
+++ b/hashes/src/hash160/mod.rs
@@ -17,7 +17,7 @@ crate::internal_macros::general_hash_type! {
}
impl Hash {
- /// Finalize a hash engine to produce a hash.
+ /// Finalizes a hash engine to produce a hash.
pub fn from_engine(e: HashEngine) -> Self {
let sha2 = sha256::Hash::from_engine(e.0);
let rmd = ripemd160::Hash::hash(sha2.as_byte_array());
diff --git a/hashes/src/lib.rs b/hashes/src/lib.rs
index 2cbb610e..2c61758b 100644
--- a/hashes/src/lib.rs
+++ b/hashes/src/lib.rs
@@ -192,7 +192,7 @@ where
drain_to_engine(&mut encoder, engine);
}
-/// Drain the output of an [`encoding::Encoder`] into a hash engine.
+/// Drains the output of an [`encoding::Encoder`] into a hash engine.
pub fn drain_to_engine<T, H>(encoder: &mut T, engine: &mut H)
where
T: encoding::Encoder + ?Sized,
diff --git a/hashes/src/ripemd160/mod.rs b/hashes/src/ripemd160/mod.rs
index 72139c88..e4512a23 100644
--- a/hashes/src/ripemd160/mod.rs
+++ b/hashes/src/ripemd160/mod.rs
@@ -19,7 +19,7 @@ crate::internal_macros::general_hash_type! {
}
impl Hash {
- /// Finalize a hash engine to produce a hash.
+ /// Finalizes a hash engine to produce a hash.
#[cfg(not(hashes_fuzz))]
pub fn from_engine(mut e: HashEngine) -> Self {
let n_bytes_hashed = e.bytes_hashed;
@@ -39,7 +39,7 @@ impl Hash {
Self(e.midstate())
}
- /// Finalize a hash engine to produce a hash.
+ /// Finalizes a hash engine to produce a hash.
#[cfg(hashes_fuzz)]
pub fn from_engine(e: HashEngine) -> Self {
let mut res = e.midstate();
diff --git a/hashes/src/sha1/mod.rs b/hashes/src/sha1/mod.rs
index 147511fd..24a6cc78 100644
--- a/hashes/src/sha1/mod.rs
+++ b/hashes/src/sha1/mod.rs
@@ -19,7 +19,7 @@ crate::internal_macros::general_hash_type! {
}
impl Hash {
- /// Finalize a hash engine to produce a hash.
+ /// Finalizes a hash engine to produce a hash.
pub fn from_engine(mut e: HashEngine) -> Self {
let n_bytes_hashed = e.bytes_hashed;
let buf_idx = incomplete_block_len(&e);
diff --git a/hashes/src/sha256/mod.rs b/hashes/src/sha256/mod.rs
index bc736446..b0492e96 100644
--- a/hashes/src/sha256/mod.rs
+++ b/hashes/src/sha256/mod.rs
@@ -28,7 +28,7 @@ crate::internal_macros::general_hash_type! {
}
impl Hash {
- /// Finalize a hash engine to obtain a hash.
+ /// Finalizes a hash engine to obtain a hash.
#[cfg(not(hashes_fuzz))]
pub fn from_engine(mut e: HashEngine) -> Self {
// pad buffer with a single 1-bit then all 0s, until there are exactly 8 bytes remaining
@@ -50,7 +50,7 @@ impl Hash {
Self(e.midstate_unchecked().bytes)
}
- /// Finalize a hash engine to obtain a hash.
+ /// Finalizes a hash engine to obtain a hash.
#[cfg(hashes_fuzz)]
pub fn from_engine(e: HashEngine) -> Self {
let mut hash = e.midstate_unchecked().bytes;
@@ -62,7 +62,7 @@ impl Hash {
Hash(hash)
}
- /// Iterate the SHA256 algorithm to turn a SHA256 hash into a `SHA256d` hash.
+ /// Iterates the SHA256 algorithm to turn a SHA256 hash into a `SHA256d` hash.
#[must_use]
pub fn hash_again(&self) -> sha256d::Hash { sha256d::Hash::from_byte_array(hash(&self.0).0) }
diff --git a/hashes/src/sha256d/mod.rs b/hashes/src/sha256d/mod.rs
index 0db4cb91..3f2613b8 100644
--- a/hashes/src/sha256d/mod.rs
+++ b/hashes/src/sha256d/mod.rs
@@ -21,7 +21,7 @@ impl Hash {
sha256::HashEngine::sha256d_64(outputs, inputs);
}
- /// Finalize a hash engine to produce a hash.
+ /// Finalizes a hash engine to produce a hash.
pub fn from_engine(e: HashEngine) -> Self {
let sha2 = sha256::Hash::from_engine(e.0);
let sha2d = sha256::Hash::hash(sha2.as_byte_array());
diff --git a/hashes/src/sha384/mod.rs b/hashes/src/sha384/mod.rs
index d87bde5d..ec95d1c3 100644
--- a/hashes/src/sha384/mod.rs
+++ b/hashes/src/sha384/mod.rs
@@ -12,7 +12,7 @@ crate::internal_macros::general_hash_type! {
}
impl Hash {
- /// Finalize a hash engine to produce a hash.
+ /// Finalizes a hash engine to produce a hash.
pub fn from_engine(e: HashEngine) -> Self {
let mut ret = [0; 48];
ret.copy_from_slice(&sha512::Hash::from_engine(e.0).as_byte_array()[..48]);
diff --git a/hashes/src/sha512/mod.rs b/hashes/src/sha512/mod.rs
index 7c8677ad..0bfed793 100644
--- a/hashes/src/sha512/mod.rs
+++ b/hashes/src/sha512/mod.rs
@@ -20,7 +20,7 @@ crate::internal_macros::general_hash_type! {
}
impl Hash {
- /// Finalize a hash engine to produce a hash.
+ /// Finalizes a hash engine to produce a hash.
#[cfg(not(hashes_fuzz))]
pub fn from_engine(mut e: HashEngine) -> Self {
let n_bytes_hashed = e.bytes_hashed;
@@ -40,7 +40,7 @@ impl Hash {
Self(e.midstate())
}
- /// Finalize a hash engine to produce a hash.
+ /// Finalizes a hash engine to produce a hash.
#[cfg(hashes_fuzz)]
pub fn from_engine(e: HashEngine) -> Self {
let mut hash = e.midstate();
diff --git a/hashes/src/sha512_256/mod.rs b/hashes/src/sha512_256/mod.rs
index 5cae9c8c..0e6201e3 100644
--- a/hashes/src/sha512_256/mod.rs
+++ b/hashes/src/sha512_256/mod.rs
@@ -21,7 +21,7 @@ crate::internal_macros::general_hash_type! {
}
impl Hash {
- /// Finalize a hash engine to produce a hash.
+ /// Finalizes a hash engine to produce a hash.
pub fn from_engine(e: HashEngine) -> Self {
let mut ret = [0; 32];
ret.copy_from_slice(&sha512::Hash::from_engine(e.0).as_byte_array()[..32]);
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.