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 .agents/rules/code-typescript.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ Applies to `*.ts` and `*.tsx`.
- Write explicit return types.
- Keep functions minimal and modular.
- Use Bun for package management; do not use npm/yarn/pnpm.
- In the example app's `package.json`, pin dependency versions exactly. No caret (`^`) or tilde (`~`) ranges. Applies to `dependencies` and `devDependencies`. Use the version `bun.lock` resolved.
- Library `package.json` (under `packages/*`) may use ranges (`^`, `>=`) for `dependencies` and `peerDependencies` to allow consumer flexibility.
- For React, minimize `useEffect`; use named effect functions if unavoidable.

## Formatting
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/BUILD_ERROR.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ body:
"react-native": "^0.74.3",
"react-native-quick-crypto": "^0.7.1",
"@craftzdog/react-native-buffer": "^6.0.5",
"react-native-quick-base64": "^2.1.2",
"react-native-quick-base64": "3.0.0",
...
},
validations:
Expand Down
10 changes: 5 additions & 5 deletions bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 29 additions & 3 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1869,8 +1869,34 @@ PODS:
- ReactCommon/turbomodule/core
- SocketRocket
- Yoga
- react-native-quick-base64 (2.2.2):
- react-native-quick-base64 (3.0.0):
- 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-safe-area-context (5.6.2):
- boost
- DoubleConversion
Expand Down Expand Up @@ -2815,7 +2841,7 @@ SPEC CHECKSUMS:
NitroMmkv: afbc5b2fbf963be567c6c545aa1efcf6a9cec68e
NitroModules: 11bba9d065af151eae51e38a6425e04c3b223ff3
OpenSSL-Universal: 9110d21982bb7e8b22a962b6db56a8aa805afde7
QuickCrypto: 3f1a7a649aa230cafd9b3576bdbc101bd10eb0ca
QuickCrypto: b6fed48151d7fef2b33e8420c660dde2b421c396
RCT-Folly: 846fda9475e61ec7bcbf8a3fe81edfcaeb090669
RCTDeprecation: c4b9e2fd0ab200e3af72b013ed6113187c607077
RCTRequired: e97dd5dafc1db8094e63bc5031e0371f092ae92a
Expand Down Expand Up @@ -2850,7 +2876,7 @@ SPEC CHECKSUMS:
React-Mapbuffer: 91e0eab42a6ae7f3e34091a126d70fc53bd3823e
React-microtasksnativemodule: 1ead4fe154df3b1ba34b5a9e35ef3c4bdfa72ccb
react-native-fast-encoder: f2728ab5e520601ba04df15716722941d941495e
react-native-quick-base64: 6568199bb2ac8e72ecdfdc73a230fbc5c1d3aac4
react-native-quick-base64: e5eea0a73474108a7b80e33ce2c004a414649da2
react-native-safe-area-context: c00143b4823773bba23f2f19f85663ae89ceb460
React-NativeModulesApple: eff2eba56030eb0d107b1642b8f853bc36a833ac
React-oscompat: b12c633e9c00f1f99467b1e0e0b8038895dae436
Expand Down
2 changes: 1 addition & 1 deletion example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"react-native-fast-encoder": "0.3.1",
"react-native-mmkv": "4.0.1",
"react-native-nitro-modules": "0.33.2",
"react-native-quick-base64": "2.2.2",
"react-native-quick-base64": "3.0.0",
"react-native-quick-crypto": "workspace:*",
"react-native-safe-area-context": "5.6.2",
"react-native-screens": "4.18.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/react-native-quick-crypto/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
"registry": "https://registry.npmjs.org/"
},
"dependencies": {
"@craftzdog/react-native-buffer": "6.1.0",
"@craftzdog/react-native-buffer": "^6.1.2",
"events": "3.3.0",
"readable-stream": "4.7.0",
"safe-buffer": "^5.2.1",
Expand All @@ -131,7 +131,7 @@
"react": "*",
"react-native": "*",
"react-native-nitro-modules": ">=0.31.2",
"react-native-quick-base64": ">=2.1.0",
"react-native-quick-base64": ">=3.0.0",
"expo": ">=48.0.0",
"expo-build-properties": "*"
},
Expand Down
19 changes: 16 additions & 3 deletions packages/react-native-quick-crypto/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
// polyfill imports
import { Buffer } from '@craftzdog/react-native-buffer';
import { toByteArray, fromByteArray } from 'react-native-quick-base64';

declare global {
// eslint-disable-next-line no-var
var base64ToArrayBuffer: (
s: string,
removeLinebreaks?: boolean,
) => ArrayBuffer;
// eslint-disable-next-line no-var
var base64FromArrayBuffer: (b: ArrayBuffer, urlSafe?: boolean) => string;
}

// API imports
import * as argon2Module from './argon2';
Expand Down Expand Up @@ -66,9 +77,11 @@ export const install = () => {
// @ts-expect-error subtle isn't fully implemented and Cryptokey is missing
global.crypto = QuickCrypto;

// Install base64 globals (base64ToArrayBuffer, base64FromArrayBuffer)
// eslint-disable-next-line @typescript-eslint/no-require-imports
require('react-native-quick-base64');
// react-native-quick-base64 v3 no longer installs these globals on import.
global.base64ToArrayBuffer = (s, removeLinebreaks) =>
toByteArray(s, removeLinebreaks).buffer as ArrayBuffer;
global.base64FromArrayBuffer = (b, urlSafe) =>
fromByteArray(new Uint8Array(b), urlSafe);
};

// random, cipher, hash use nextTick
Expand Down
Loading