React Native SHA1 / SHA256 / SHA512 / HMAC-SHA256
SHA Hash native module for react-native
Installation
npm install --save react-native-sha-hash
or
yarn add react-native-sha-hash
Installation (iOS)
Using CocoaPods (React Native 0.60 and higher)
cd iospod install
Installation (Android)
React Native 0.60 and higher
- Linking automatically
Usage
Example
var SHA = NativeModulesSha
SHA1
private sha1
SHA256
private sha256
SHA512
private sha512
HMAC-SHA256
private hmac256
iOS Test
LOG plaing string : 1234567890 LOG SHA1 hash : 01b307acba4f54f55aafc33bb06bbbf6ca803e9a LOG SHA256 hash : c775e7b757ede630cd0aa1113bd102661ab38829ca52a6422ab782862f268646 LOG SHA512 hash : 12b03226a6d8be9c6e8cd5e55dc6c7920caaa39df14aab92d5e3ea9340d1c8a4d3d0b8e4314f1f6ef131ba4bf1ceb9186ab87c801af0d5c95b1befb8cedae2b9 LOG HMAC SHA256 key : 1234567890123456 LOG HMAC SHA256 hash : 6bda0db7eca1d37b25d7beadae2290fa6a8b894ed02f0bc6e3d92583ae1a0dbe
Android Test
LOG plaing string : 1234567890 LOG SHA1 hash : 01b307acba4f54f55aafc33bb06bbbf6ca803e9a LOG SHA256 hash : c775e7b757ede630cd0aa1113bd102661ab38829ca52a6422ab782862f268646 LOG SHA512 hash : 12b03226a6d8be9c6e8cd5e55dc6c7920caaa39df14aab92d5e3ea9340d1c8a4d3d0b8e4314f1f6ef131ba4bf1ceb9186ab87c801af0d5c95b1befb8cedae2b9 LOG HMAC SHA256 key : 1234567890123456 LOG HMAC SHA256 hash : 6bda0db7eca1d37b25d7beadae2290fa6a8b894ed02f0bc6e3d92583ae1a0dbe