tradle/rn-nodeify

pbkdf2 hack breaks the lib

Fubinator opened this issue · 4 comments

The hack replaces process.version with the actual version of the process, however there is a global.process.version which is replaced to global."ACTUAL VERSION", which breaks.

The default-encoding.js gets hacked to:

var defaultEncoding
/* istanbul ignore next */
if (global.process && global.process.browser) {
  defaultEncoding = 'utf-8'
} else if (global.process && global."v15.12.0") {
  var pVersionMajor = parseInt(process.version.split('.')[0].slice(1), 10)

  defaultEncoding = pVersionMajor >= 6 ? 'utf-8' : 'binary'
} else {
  defaultEncoding = 'utf-8'
}
module.exports = defaultEncoding

Reproduction (just clone, install deps, and run):
https://github.com/Fubinator/react-native-userbase-poc

@Fubinator can u check if this solves your issue? #103 (comment)

Yep, that works, thank you! Sorry that I didn't check the repo for that issue properly. Are you planning to merge that? Feel free to close this issue.

@Fubinator i've yet to test it myself, want to make a PR?

Sure, I'm gonna try making the PR tomorrow!