Giter VIP home page Giter VIP logo

bcrypt-react-native's Introduction

bcrypt-react-native

Native implementation of bcrypt for react-native.

Uses BCrypt for iOS.

Installation

npm install bcrypt-react-native

or

yarn add bcrypt-react-native
cd ios && pod install

Usage

import BcryptReactNative from 'bcrypt-react-native';

// ...
try{

const salt = await BcryptReactNative.getSalt(10);
const hash = await BcryptReactNative.hash(salt, 'password');
const isSame = await BcryptReactNative.compareSync('password', hash);
} catch(e) {
  console.log({ e })
}

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT

bcrypt-react-native's People

Contributors

andreshsingh avatar

Stargazers

Naftali Murgor avatar quannqvvt avatar  avatar Antoniel Carlos Amaral avatar  avatar gabimoncha avatar Sanzhar Shakhmerden avatar Michael Demarais avatar Pavi avatar Jayan avatar Sujal Kokh Shrestha avatar

Watchers

James Cloos avatar  avatar

Forkers

thiagocazzeri

bcrypt-react-native's Issues

.hash Parameter order

This library's first example has the Hash function with parameters the opposite way round to other implementations:
This library:
const hash = await BcryptReactNative.hash(salt, 'password');

vs

var hash = bcrypt.hashSync("B4c0/\/", salt);
https://www.npmjs.com/package/react-native-bcrypt

and:

const hash = bcrypt.hashSync(myPlaintextPassword, salt);```
https://github.com/kelektiv/node.bcrypt.js

Is this intended?

I've been struggling to get a comparison to succeed with the sync function as was wondering if there's a simple parameter swap going on.

Type Error : null is not an object

Here's the code :

import BcryptReactNative form 'bcrypt-react-native'

export async function pswrdApiTest(email, plainPass){
  console.log('PSWRD API FUNC START');
  return await fetch( PSWRD_ROUTE(email) )
    .then( response => response.json())
      .then( async (json) => {
        if ( json == null ) { return false; }
        else {
          console.log('Password : '+json.data)
          const check = await BcryptReactNative.compareSync(plainPass, json.data);
          console.log('Pass Check : '+check);
          return check;
        }
      })
      .catch( error => { console.error('Password Test Error : '+error); } );
}

Here's the output ::

Selection_008

Trying to build an Android app in React-Native, I'm using Expo for development.

Null is not an object error

Trying to use the npm package via npm install in an expo application (running on IOS14)
running any methode from the package gives me the following error:

  "e": [TypeError: null is not an object (evaluating 'BcryptReactNative.default.getSalt')

I am grateful for any ideas?

Decrypt hash

Hi guys!

Is there any way to use this package to decrypt the hash?

Running cd pod install produces error on Mac

Please how do I solve this ?

[!] CocoaPods could not find compatible versions for pod "bcrypt-react-native":
In Podfile:
bcrypt-react-native (from ../node_modules/bcrypt-react-native)

Specs satisfying the bcrypt-react-native (from ../node_modules/bcrypt-react-native) dependency were found, but they required a higher minimum deployment target.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.