Comments (11)
how exactly are you importing this? are you doing
var crypto = require('browserify-crypto');
because last I checked react-native doesn't include this by default
from pbkdf2.
@calvinmetcalf
I used the babel-plugin-rewrite-require to do that
sth like this:
from pbkdf2.
so it sounds like that's not working, right, you may want to trouble shoot with the plugin
from pbkdf2.
actually the issue you have is that it isn't grabbing the browser version of packages like it should and is instead grabbing the nodejs version which assumes there is already a crypto object available and just tries to augment it
from pbkdf2.
@calvinmetcalf I think we need to improve this crypto.pbkdf2Sync.toString().indexOf('keylen, digest') === -1
. Because sth like when you import to react-native, the code will be minified so it will throw error
from pbkdf2.
so the issue is that it shouldn't be loaded in the first place but whatever your config is isn't respecting the browser field in the package.json
from pbkdf2.
I mean that 'keylen, digest' will be minified so it will be sth like a,b
from pbkdf2.
again, the fact that you are loading that file while not in node in the first place is a bug but it can't hurt to fail better in that case, see #71
from pbkdf2.
The problem is, in react native app, index.js is use instead of browser version. I have no problem with another npm packages
from pbkdf2.
We have a typescript project and we use karma + phantomjs for our unit tests. However when trying to update typescript version our tests break because of this. Removing the if- check from the pdkf2-module makes tests work normally again.
from pbkdf2.
should be fixed and published
from pbkdf2.
Related Issues (20)
- why we need to check crypto.pbkdf2Sync.toString() ? HOT 2
- In 9.0.0, sha1 is not defaulted HOT 2
- Ripemd160 throws when used HOT 1
- Allow using this library with Uint8Array HOT 2
- DoS with long password HOT 5
- How to improve the performance HOT 2
- works on browser? HOT 2
- Can I decode it?
- version change from 3.0.7 to 3.1.0 HOT 6
- pbkdf2.pbkdf2Sync('password', 'salt', 1, 32, 'sha512') returns array not string HOT 1
- The value "NaN" is invalid for option "size" HOT 2
- Uint8Array tests fail on s390x
- Incompatibility with rn-nodeify HOT 5
- Issue in pbkdf2/lib/default-encoding.js HOT 1
- process.version is undefined in lib/default-encoding.js on electron app
- pbkdf2\lib\default-encoding.js, process.version is undefine,
- In the electronic application, when I start nodeintegration, the program appears default-encoding.js? 9f9d:10 Uncaught TypeError: Cannot read property 'split' of undefined HOT 1
- pbkdf2 failing on some development environments
- pbkdf2\lib\default-encoding.js, Unexpected token (5:36) HOT 1
- Please consider upgrading the default hash function
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pbkdf2.