0

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.

11
  • 3
    Google SHA-256 javascript brings up a number of the popular ones. Commented Jul 4, 2015 at 9:21
  • 1
    how do you define "fast" vs not fast, or "compact" vs not compact? Commented Jul 4, 2015 at 9:21
  • @Xotic750 this is actually more of a wiki answer, see my answer Commented Jul 4, 2015 at 9:27
  • @JaromandaX fast: Computationally efficient, e.g. an implementation returning the secure hash within 5ms would be fast. Compact: few KB, e.g. an implementation of 10KB size would be compact Commented Jul 4, 2015 at 9:29
  • 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. Commented Jul 4, 2015 at 9:30

1 Answer 1

1

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.

Sign up to request clarification or add additional context in comments.

3 Comments

Doing some tests suggests that forge is the fastest SHA-256 JavaScript implementation. What tests did you independently perform?
2018 answer: Bichlmeier SHA256 seems to be 2X as fast as forge

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.