Skip to content

Commit

Permalink
fix: provide prefix-freedom in Hash impls
Browse files Browse the repository at this point in the history
  • Loading branch information
seanmonstar committed Dec 24, 2024
1 parent de5ebf0 commit 1da9714
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/ascii.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ impl<S: AsRef<str>> Hash for Ascii<S> {
for byte in self.as_ref().bytes().map(|b| b.to_ascii_lowercase()) {
hasher.write_u8(byte);
}
// prefix-freedom
hasher.write_u8(0xFF);
}
}

Expand Down
2 changes: 2 additions & 0 deletions src/unicode/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ impl<S: AsRef<str>> Hash for Unicode<S> {
hasher.write_u8(b);
}
}
// prefix-freedom
hasher.write_u8(0xFF);
}
}

Expand Down

0 comments on commit 1da9714

Please sign in to comment.