Skip to content

feat: add verify method with cross-platform auto mode detection#27

Open
div02-afk wants to merge 1 commit into
poowf:masterfrom
div02-afk:feat/verfiy-method
Open

feat: add verify method with cross-platform auto mode detection#27
div02-afk wants to merge 1 commit into
poowf:masterfrom
div02-afk:feat/verfiy-method

Conversation

@div02-afk

@div02-afk div02-afk commented Jul 13, 2026

Copy link
Copy Markdown

Adds a verify(password, encodedHash) function to check whether a plaintext password matches an existing Argon2 encoded hash.

Changes

  • iOS — implemented via Argon2Swift.verifyHashString, which auto-detects the hash mode from the encoded string
  • Android — implemented via argon2kt.verify, with mode auto-detected by parsing the encoded hash prefix ($argon2id$, $argon2i$, $argon2d$)
  • JS — exported as a named export alongside the existing default argon2 export
  • Typesverify(password, encodedHash): Promise<boolean> added to index.d.ts
  • package.jsonreact-native added as a peer dependency
  • README — usage examples and Verify section updated

Usage

import argon2, { verify } from 'react-native-argon2';

const { encodedHash } = await argon2(password, salt);
const isValid = await verify(password, encodedHash); // true

resolves #26

@div02-afk

Copy link
Copy Markdown
Author

@zanechua please review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missing Verify Method

1 participant