Socket
Book a DemoInstallSign in
Socket

react-native-argon2

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-argon2

React Native Wrapper around Argon2

latest
Source
npmnpm
Version
2.0.1
Version published
Maintainers
1
Created
Source

react-native-argon2

React Native Wrapper around native Argon2 implementations:

iOS: CatCrypto

Android: argon2kt

Getting started

npm install react-native-argon2 --save

Compatibility Table

React Native VersionPackage Version
0.60 - 0.63.2~0.1.0
0.63.3^1.0.0

Usage

import argon2 from 'react-native-argon2';
const password = 'password';
const salt = '1234567891011121314151617181920212223242526272829303132333435363';
const result = await argon2(password, salt, {});
const { rawHash, encodedHash } = result;
// rawHash: 031d6c82ddede1200f4794605052745dd562bd4db358e23dac1b11c052eff8d9
// encodedHash: $argon2id$v=19$m=32768,t=2,p=1$MTIzNDU2Nzg5MTAxMTEyMTMxNDE1MTYxNzE4MTkyMDIxMjIyMzI0MjUyNjI3MjgyOTMwMzEzMjMzMzQzNTM2Mw$Ax1sgt3t4SAPR5RgUFJ0XdVivU2zWOI9rBsRwFLv+Nk

Input

The package takes in the following variables:

ParameterType
passwordstring
saltstring
configobject
config.iterationsinteger
config.memoryinteger
config.parallelisminteger
config.hashLengthinteger
config.modestring

You are not required to configure the third parameter which is the config object, however you do have to provide an empty object to it if you are not changing any of the values. You can set config values with the following example:

const result = await argon2(
    password,
    salt,
    {
      iterations: 5,
      memory: 16 * 1024,
      parallelism: 2,
      hashLength: 20,
      mode: 'argon2i'
    }
);

Output

rawHash is the hexadecimal representation

encodedHash is the string representation

Keywords

argon2

FAQs

Package last updated on 20 Jun 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.