react-native-fast-create-hash
Fast, native createHash implementation for React Native.
- Uses CryptoKit on iOS and requires a target of >= 13.0.
- Uses MessageDigest on Android.
- Supports SHA-256, SHA-384, and SHA-512.
- Input and output data are instances of Unit8Array or Buffer.
- Inspired by react-native-fast-crypto.
Installation
yarn add @mfellner/react-native-fast-create-hash
Usage
import { createHash } from '@mfellner/react-native-fast-create-hash';
import { Buffer } from 'buffer';
const buffer: Buffer = await createHash(Buffer.from('hello'), 'sha256');
createHash(data: Uint8Array, algorithm: Algorithm): Promise<Buffer>
-
data
– Raw input bytes to be hashed. -
algorithm
– Name of a supported SHA algorithm. - Returns: Raw bytes of the hash digest.
Contributing
See the contributing guide to learn how to contribute to the repository and the development workflow.