paulmillr / noble-hashes

Audited & minimal JS implementation of hash functions, MACs and KDFs.
https://paulmillr.com/noble
MIT License
573 stars 46 forks source link

fix: Uint8Array check rare issue #78

Closed Muhammad-Altabba closed 10 months ago

Muhammad-Altabba commented 10 months ago

Fixes #25 as in https://github.com/paulmillr/noble-hashes/issues/25#issuecomment-1750106284

paulmillr commented 10 months ago

?. operator should be avoided because it's new and because

  return (
    a instanceof Uint8Array ||
    (a != null && typeof a === 'object' && a.constructor.name === 'Uint8Array')
  );

does all the proper work itself

thanks