I'm looking for a hash implementation that is;
- secure (practically impossible to invert)
- fast (few ms)
- light (few KB)
- runs in the browser
Ideally a SHA-256 implementation, since it is widely used and therefore widely tested against.
Doing some tests suggests that forge is the fastest SHA-256 JavaScript implementation.
It is 284KB big but extracting the SHA-256 related code reduces the size to 4.5 KB, see https://github.com/brillout/forge-sha256.
Doing some tests suggests that forge is the fastest SHA-256 JavaScript implementation. What tests did you independently perform?
SHA-256 javascriptbrings up a number of the popular ones.Questions asking us to recommend or find a book, tool, software library, tutorial or other off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.