dchest / scrypt-async-js

Fast "async" scrypt implementation in JavaScript
http://dchest.github.io/scrypt-async-js/
BSD 2-Clause "Simplified" License
139 stars 26 forks source link

it's blocking in IE 11 #33

Closed nianhua110 closed 7 years ago

nianhua110 commented 7 years ago

I used it with react . it is fun on Chrome but UI blocking so long time on ie 11

function handleSubmit(e) {
    e.preventDefault();

    validateFieldsAndScroll((err, values) => {
      if (err) {
        return;
      }
      const username = values.username;
      const password = values.password;

        scrypt(password, username + siteId, scryptParam,
          (derivedKey) => {
            onOk({ username, password: derivedKey , type: 'login'});
          })
      console.log('timeout Set');
    });
  }
dchest commented 7 years ago

What's in scryptParam?

nianhua110 commented 7 years ago

export const scryptParam = { N: 16384, r: 8, p: 1, dkLen: 64, encoding: 'hex', }; sorry for not reply long time!

dchest commented 7 years ago

You're missing interruptStep to make it non-blocking — check out docs about it here: https://github.com/dchest/scrypt-async-js#modern-api

It will not be faster, though — that's because IE11 is just slow.

nianhua110 commented 7 years ago

ok