Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a dedicated length-prefixing method to Hasher #94598

Merged
merged 2 commits into from
May 6, 2022

Commits on May 6, 2022

  1. Add a dedicated length-prefixing method to Hasher

    This accomplishes two main goals:
    - Make it clear who is responsible for prefix-freedom, including how they should do it
    - Make it feasible for a `Hasher` that *doesn't* care about Hash-DoS resistance to get better performance by not hashing lengths
    
    This does not change rustc-hash, since that's in an external crate, but that could potentially use it in future.
    scottmcm committed May 6, 2022
    Configuration menu
    Copy the full SHA
    9805437 View commit details
    Browse the repository at this point in the history
  2. For now, don't change the details of hashing a str

    We might want to change the default before stabilizing (or maybe even after), but for getting in the new unstable methods, leave it as-is for now.  That way it won't break cargo and such.
    scottmcm committed May 6, 2022
    Configuration menu
    Copy the full SHA
    ebdcb08 View commit details
    Browse the repository at this point in the history