eboansi / crypto-js

Automatically exported from code.google.com/p/crypto-js
0 stars 0 forks source link

PBKDF2Async updates too much and is very slow. #26

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Due to the way setTimeout forces the browser to wait at minimum 4 ms before 
resuming the computation it makes the async pbkdf2 very slow, taking a full 10 
seconds with 2000 iterations. I've added a loop forcing it to compute for at 
least 100ms before returning to the browser, this gives it speed without much 
browser lag:

while (i < iterations && ((new Date()).getTime() - start.getTime()) < 100)

I've attached a copy of the source for reference. 

Original issue reported on code.google.com by ultraman...@gmail.com on 21 Feb 2012 at 6:03

Attachments:

GoogleCodeExporter commented 9 years ago
Fixed in r519 and released in v2.5.4.

Original comment by Jeff.Mott.OR on 30 May 2012 at 2:12