LinusU / secure-remote-password

A modern SRP implementation for Node.js and Web Browsers
101 stars 22 forks source link

TypeError: hexToArrayBuffer is not a function #32

Closed t3db0t closed 1 year ago

t3db0t commented 2 years ago

(In 'hexToArrayBuffer(arg.toHex())', 'hexToArrayBuffer' is an instance of Object)

I'm getting this error while trying to use the library in a React Native project. I started building the project on a new computer and now I'm getting this error from line 25 in sha256.js. Any idea what could be causing this?

LinusU commented 1 year ago

Hmm, this is strange. What does npm ls hex-to-array-buffer gives you?

t3db0t commented 1 year ago

I solved the problem, but I don't understand why. I changed const hexToArrayBuffer = require('hex-to-array-buffer') to import hexToArrayBuffer from 'hex-to-array-buffer'; and it works now...