Skip to content

Fast C++ implementation with JSI binding of MD5 for React Native

License

Notifications You must be signed in to change notification settings

craftzdog/react-native-quick-md5

Repository files navigation

react-native-quick-md5

Blazingly fast C++ implementation with JSI binding of MD5 for React Native.

Confirmed that it's 10x faster than using spark-md5 on an iPhone 11 Pro and 8x faster on an Essential Phone. You can check out the benchmark tests under example.

Installation

npm install react-native-quick-md5

Usage

import { stringMd5 } from 'react-native-quick-md5';

const md5 = stringMd5('hoge');
// => "ea703e7aa1efda0064eaa507d9e8ab7e"

stringMd5(data: string): string

Calculate MD5 for given UTF-8 string data. Returns hex encoded hash.

binaryMd5(data: string | ArrayBuffer): string

Calculate MD5 for given binary string or ArrayBuffer data. Returns hex encoded hash.

Contributing

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

License

MIT

See also