akamsteeg / AtleX.HaveIBeenPwned

A fully async .NET Standard client library for the API of HaveIBeenPwned.com
https://www.nuget.org/packages/AtleX.HaveIBeenPwned/
MIT License
5 stars 0 forks source link

Replace `HashCodeHelper` with `System.HashCode` #51

Open akamsteeg opened 3 years ago

akamsteeg commented 3 years ago

Right now, we have our own hashcode calculator in the form of HashCodeHelper. But in .NET Standard 2.1+, System.HashCode was introduced. Can we replace our handrolled hashcode calculator with the one supplied by the framework?

Todo:

akamsteeg commented 8 months ago

I've investigated this some more but it's really tricky to implement this. We have to consider the long tail here. If a user of the lib cached the pastes or breaches first on a lower version of .NET, or stored them in a database or something, and then compares the records we'd be screwed with a HashCode implementation. We must use a stable hash code calculation instead.