Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -186,3 +186,5 @@ tsconfig.tsbuildinfo

# development stuffs
*scratch*

.claude/settings.local.json
14 changes: 11 additions & 3 deletions bun.lock
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
},
"example": {
"name": "react-native-quick-crypto-example",
"version": "1.0.0-beta.23",
"version": "1.0.0",
"dependencies": {
"@craftzdog/react-native-buffer": "6.1.0",
"@noble/ciphers": "^2.0.1",
Expand All @@ -47,9 +47,10 @@
"react": "19.1.0",
"react-native": "0.81.1",
"react-native-bouncy-checkbox": "4.1.2",
"react-native-fast-encoder": "^0.3.1",
"react-native-nitro-modules": "0.29.1",
"react-native-quick-base64": "2.2.2",
"react-native-quick-crypto": "1.0.0-beta.23",
"react-native-quick-crypto": "workspace:*",
"react-native-safe-area-context": "^5.2.2",
"react-native-screens": "4.18.0",
"react-native-vector-icons": "^10.3.0",
Expand Down Expand Up @@ -79,13 +80,14 @@
"@types/react-test-renderer": "^19.1.0",
"babel-jest": "29.7.0",
"babel-plugin-module-resolver": "5.0.2",
"jose": "^6.1.3",
"react-test-renderer": "19.1.0",
"typescript": "^5.8.3",
},
},
"packages/react-native-quick-crypto": {
"name": "react-native-quick-crypto",
"version": "1.0.0-beta.23",
"version": "1.0.0",
"dependencies": {
"@craftzdog/react-native-buffer": "6.1.0",
"events": "3.3.0",
Expand Down Expand Up @@ -1362,6 +1364,8 @@

"flat-cache": ["flat-cache@4.0.1", "", { "dependencies": { "flatted": "^3.2.9", "keyv": "^4.5.4" } }, ""],

"flatbuffers": ["flatbuffers@2.0.6", "", {}, "sha512-QTTZTXTbVfuOVQu2X6eLOw4vefUxnFJZxAKeN3rEPhjEzBtIbehimJLfVGHPM8iX0Na+9i76SBEg0skf0c0sCA=="],

"flatted": ["flatted@3.3.1", "", {}, ""],

"flow-enums-runtime": ["flow-enums-runtime@0.0.6", "", {}, ""],
Expand Down Expand Up @@ -1680,6 +1684,8 @@

"joi": ["joi@17.13.3", "", { "dependencies": { "@hapi/hoek": "^9.3.0", "@hapi/topo": "^5.1.0", "@sideway/address": "^4.1.5", "@sideway/formula": "^3.0.1", "@sideway/pinpoint": "^2.0.0" } }, ""],

"jose": ["jose@6.1.3", "", {}, "sha512-0TpaTfihd4QMNwrz/ob2Bp7X04yuxJkjRGi4aKmOqwhov54i6u79oCv7T+C7lo70MKH6BesI3vscD1yb/yzKXQ=="],

"js-tokens": ["js-tokens@4.0.0", "", {}, ""],

"js-yaml": ["js-yaml@4.1.0", "", { "dependencies": { "argparse": "^2.0.1" }, "bin": "bin/js-yaml.js" }, ""],
Expand Down Expand Up @@ -2102,6 +2108,8 @@

"react-native-builder-bob": ["react-native-builder-bob@0.40.15", "", { "dependencies": { "@babel/core": "^7.25.2", "@babel/plugin-transform-flow-strip-types": "^7.26.5", "@babel/plugin-transform-strict-mode": "^7.24.7", "@babel/preset-env": "^7.25.2", "@babel/preset-react": "^7.24.7", "@babel/preset-typescript": "^7.24.7", "arktype": "^2.1.15", "babel-plugin-syntax-hermes-parser": "^0.28.0", "browserslist": "^4.20.4", "cross-spawn": "^7.0.3", "dedent": "^0.7.0", "del": "^6.1.1", "escape-string-regexp": "^4.0.0", "fs-extra": "^10.1.0", "glob": "^8.0.3", "is-git-dirty": "^2.0.1", "json5": "^2.2.1", "kleur": "^4.1.4", "prompts": "^2.4.2", "react-native-monorepo-config": "^0.1.8", "which": "^2.0.2", "yargs": "^17.5.1" }, "bin": { "bob": "bin/bob" } }, "sha512-p70LXlYOe53bZeEQchbK1hIhBGQsuB13bT81E7KkOe4dQABwMV6c585A4np0c3nwTTaqQMDYUat4x7J0oLnjxQ=="],

"react-native-fast-encoder": ["react-native-fast-encoder@0.3.1", "", { "dependencies": { "big-integer": "^1.6.51", "flatbuffers": "2.0.6" }, "peerDependencies": { "react": "*", "react-native": "*" } }, "sha512-D5ZEbffxayZImtUUErbNod+7IvJITkxTCPZAQTFg6lrSjl/443Mk5CvT9nKpJC1w4cg2llWk6QP8nczij5ClcQ=="],

"react-native-monorepo-config": ["react-native-monorepo-config@0.1.10", "", { "dependencies": { "escape-string-regexp": "^5.0.0", "fast-glob": "^3.3.3" } }, "sha512-v0rlaLZiCUg95Mpw6xNRQce5k9yio0qscKjNQaPtFYMNL75YugS2UPUItIPLIRbZubK+s2/LRzBjX+mdyUgh4g=="],

"react-native-nitro-modules": ["react-native-nitro-modules@0.29.1", "", { "peerDependencies": { "react": "*", "react-native": "*" } }, "sha512-91A/Lc4Zc1Bvzj1iMSnD6vA5Swqv8aVcwGcv8ddjoPd9mahNvVS2arFh3o7kAqRH4RIh3KcQ0NpYslu7AYn55Q=="],
Expand Down
25 changes: 25 additions & 0 deletions example/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,31 @@
import { install } from 'react-native-quick-crypto';
install();

// TextEncoder/TextDecoder polyfill (required for jose)
import FastEncoder from 'react-native-fast-encoder';
class TextEncoderPolyfill {
encode(input: string): Uint8Array {
const encoder = new FastEncoder();
return encoder.encode(input);
}
}
class TextDecoderPolyfill {
private encoder: FastEncoder;
constructor(_encoding: string = 'utf-8') {
this.encoder = new FastEncoder(_encoding);
}
decode(input: Uint8Array): string {
return this.encoder.decode(input);
}
}
global.TextEncoder = TextEncoderPolyfill as unknown as typeof TextEncoder;
global.TextDecoder = TextDecoderPolyfill as unknown as typeof TextDecoder;

// structuredClone polyfill (required for jose)
if (typeof global.structuredClone === 'undefined') {
global.structuredClone = <T>(obj: T): T => JSON.parse(JSON.stringify(obj));
}

// event-target-shim
import 'event-target-polyfill';

Expand Down
32 changes: 32 additions & 0 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1809,6 +1809,34 @@ PODS:
- React-RCTFBReactNativeSpec
- ReactCommon/turbomodule/core
- SocketRocket
- react-native-fast-encoder (0.3.1):
- boost
- DoubleConversion
- fast_float
- fmt
- glog
- hermes-engine
- RCT-Folly
- RCT-Folly/Fabric
- RCTRequired
- RCTTypeSafety
- React-Core
- React-debug
- React-Fabric
- React-featureflags
- React-graphics
- React-ImageManager
- React-jsi
- React-NativeModulesApple
- React-RCTFabric
- React-renderercss
- React-rendererdebug
- React-utils
- ReactCodegen
- ReactCommon/turbomodule/bridging
- ReactCommon/turbomodule/core
- SocketRocket
- Yoga
- react-native-quick-base64 (2.2.2):
- React-Core
- react-native-safe-area-context (5.6.2):
Expand Down Expand Up @@ -2537,6 +2565,7 @@ DEPENDENCIES:
- React-logger (from `../../node_modules/react-native/ReactCommon/logger`)
- React-Mapbuffer (from `../../node_modules/react-native/ReactCommon`)
- React-microtasksnativemodule (from `../../node_modules/react-native/ReactCommon/react/nativemodule/microtasks`)
- react-native-fast-encoder (from `../../node_modules/react-native-fast-encoder`)
- react-native-quick-base64 (from `../../node_modules/react-native-quick-base64`)
- react-native-safe-area-context (from `../../node_modules/react-native-safe-area-context`)
- React-NativeModulesApple (from `../../node_modules/react-native/ReactCommon/react/nativemodule/core/platform/ios`)
Expand Down Expand Up @@ -2665,6 +2694,8 @@ EXTERNAL SOURCES:
:path: "../../node_modules/react-native/ReactCommon"
React-microtasksnativemodule:
:path: "../../node_modules/react-native/ReactCommon/react/nativemodule/microtasks"
react-native-fast-encoder:
:path: "../../node_modules/react-native-fast-encoder"
react-native-quick-base64:
:path: "../../node_modules/react-native-quick-base64"
react-native-safe-area-context:
Expand Down Expand Up @@ -2780,6 +2811,7 @@ SPEC CHECKSUMS:
React-logger: 7aef4d74123e5e3d267e5af1fbf5135b5a0d8381
React-Mapbuffer: 91e0eab42a6ae7f3e34091a126d70fc53bd3823e
React-microtasksnativemodule: 1ead4fe154df3b1ba34b5a9e35ef3c4bdfa72ccb
react-native-fast-encoder: f2728ab5e520601ba04df15716722941d941495e
react-native-quick-base64: 6568199bb2ac8e72ecdfdc73a230fbc5c1d3aac4
react-native-safe-area-context: c00143b4823773bba23f2f19f85663ae89ceb460
React-NativeModulesApple: eff2eba56030eb0d107b1642b8f853bc36a833ac
Expand Down
4 changes: 3 additions & 1 deletion example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,10 @@
"react": "19.1.0",
"react-native": "0.81.1",
"react-native-bouncy-checkbox": "4.1.2",
"react-native-fast-encoder": "^0.3.1",
"react-native-nitro-modules": "0.29.1",
"react-native-quick-base64": "2.2.2",
"react-native-quick-crypto": "1.0.0",
"react-native-quick-crypto": "workspace:*",
"react-native-safe-area-context": "^5.2.2",
"react-native-screens": "4.18.0",
"react-native-vector-icons": "^10.3.0",
Expand Down Expand Up @@ -68,6 +69,7 @@
"@types/react-test-renderer": "^19.1.0",
"babel-jest": "29.7.0",
"babel-plugin-module-resolver": "5.0.2",
"jose": "6.1.3",
"react-test-renderer": "19.1.0",
"typescript": "^5.8.3"
},
Expand Down
1 change: 1 addition & 0 deletions example/src/hooks/useTestsList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import '../tests/cfrg/x25519_tests';
import '../tests/constants/constants_tests';
import '../tests/hash/hash_tests';
import '../tests/hmac/hmac_tests';
import '../tests/jose/jose';
import '../tests/keys/sign_verify_streaming';
import '../tests/keys/public_cipher';
import '../tests/keys/create_keys';
Expand Down
Loading