パッケージの詳細

@sphereon/react-native-argon2

poowf1.3kMIT2.0.9

React Native Wrapper around Argon2

argon2, react-native, react, ios

readme

react-native-argon2

React Native Wrapper around native Argon2 implementations:

iOS: CatCrypto

Android: argon2kt

Getting started

npm install @sphereon/react-native-argon2 --save

Compatibility Table

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

Usage

import argon2 from '@sphereon/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:

Parameter Type
password string
salt string
config object
config.iterations integer
config.memory integer
config.parallelism integer
config.hashLength integer
config.mode string

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

更新履歴

Changelog

2.0.9 (2023-03-11)

Maintenance

  • prep for next dev cycle (92a01a8)
  • update readme and yarn.lock (93e2a7a)

2.0.7 (2022-08-23)

Maintenance

  • update yarn.lock (9345aaa)
  • use maven central instead of jcenter (269c64e)

2.0.1 (2021-06-20)

Maintenance

2.0.0 (2020-10-24)

⚠ BREAKING CHANGES

  • Switch to argon2kt for Android due to licensing issues
  • Switch to CatCrypto for iOS due to licensing issues

Features

  • Implement configurable hasher (099a8d5)
  • Switch to argon2kt for Android due to licensing issues (d3e575b)
  • Switch to CatCrypto for iOS due to licensing issues (0ad6598)

1.1.1 (2020-10-22)

Maintenance

1.1.0 (2020-10-22)

Features

  • Add standard-version for releases (f057b8e)
  • Use published cocoapods instead (a8b4101)

Bug Fixes

  • Failing builds on XCode 12 (19eeaee)
  • XCode project warnings (f40bc7b)

Maintenance

1.0.0 (2020-10-18)

Features

  • Add standard-version for releases (f057b8e)
  • Use published cocoapods instead (a8b4101)

Bug Fixes

  • Failing builds on XCode 12 (19eeaee)
  • XCode project warnings (f40bc7b)