|
| 1 | +# Releases |
| 2 | + |
| 3 | +## v2.0.0 - Switchable engines (`native` / `zig`) and API update |
| 4 | + |
| 5 | +### Breaking changes |
| 6 | + |
| 7 | +- `HashOptions.mode` removed from public API. Passing `mode` now returns `E_INVALID_ARGUMENT`. |
| 8 | +- HMAC moved to dedicated algorithms: `HMAC-SHA-224`, `HMAC-SHA-256`, |
| 9 | + `HMAC-SHA-384`, `HMAC-SHA-512`, `HMAC-MD5`, `HMAC-SHA-1`. |
| 10 | +- Keyed/plain selection for `BLAKE3` is now inferred from presence of `key`. |
| 11 | +- `key` is now valid only for HMAC algorithms and `BLAKE3`; for other |
| 12 | + algorithms it returns `E_INVALID_ARGUMENT`. |
| 13 | +- `hashString(...)` was replaced by `stringHash(...)` as the primary API. |
| 14 | + `hashString(...)` remains as a deprecated alias for migration. |
| 15 | +- Output contract is fixed: both `fileHash` and `stringHash` return lowercase |
| 16 | + hex digest strings. |
| 17 | + |
| 18 | +### Added |
| 19 | + |
| 20 | +- New optional `zig` engine with stable Zig C ABI integration. |
| 21 | +- Build-time engine selection (`native` by default, optional `zig`) for Android |
| 22 | + and iOS. |
| 23 | +- Runtime diagnostics APIs: |
| 24 | + - `getRuntimeInfo()` |
| 25 | + - `getRuntimeDiagnostics()` |
| 26 | +- Expo config plugin support (`app.plugin.js`) to set engine in prebuild/EAS. |
| 27 | +- New benchmark document and size/perf helper scripts: |
| 28 | + - `BENCHMARKS.md` |
| 29 | + - `scripts/compare-size-android.sh` |
| 30 | + - `scripts/compare-size-ios.sh` |
| 31 | + |
| 32 | +### Changed |
| 33 | + |
| 34 | +- Android engine internals split into explicit executors (`NativeHashEngine`, |
| 35 | + `ZigHashEngine`) with shared module routing. |
| 36 | +- Android Zig path now uses native fallback for `SHA-224` / `SHA-256` and |
| 37 | + matching HMAC variants in shipped generic Zig setup to avoid SHA-2 latency |
| 38 | + cliffs on devices without ARM64 `sha2` acceleration in prebuilt config. |
| 39 | +- iOS bridge refactored into dedicated internal helpers for native and Zig |
| 40 | + paths (`FileHashBridgeNative`, `FileHashBridgeZig`, `FileHashZigHelpers`). |
| 41 | +- `fileHash` support for provider-backed paths was hardened on both platforms |
| 42 | + (`content://` on Android, security-scoped/provider URLs on iOS). |
| 43 | + |
| 44 | +### CI / Tooling |
| 45 | + |
| 46 | +- Added reusable Zig setup action (`.github/actions/setup-zig`). |
| 47 | +- Expanded CI coverage for native and Zig paths (including Android unit tests |
| 48 | + and runtime smoke flows). |
| 49 | + |
| 50 | +--- |
| 51 | + |
| 52 | +## v1.1.3 - 16KB page alignment for Play Store |
| 53 | + |
| 54 | +- What's new |
| 55 | + |
| 56 | + - Android: enable 16KB page alignment for native library to satisfy Play Store requirements. |
| 57 | + - Guard the linker flag when unsupported; builds continue without 16KB alignment. |
| 58 | + - README: document 16KB alignment and tested NDK (27.1.x). |
| 59 | + |
| 60 | +- Tooling |
| 61 | + - Bump Yarn to 4.12.0 and refresh example locks. |
| 62 | + |
| 63 | +--- |
| 64 | + |
| 65 | +## v1.1.2 – bundle native sources in npm package |
| 66 | + |
| 67 | +Fix |
| 68 | + |
| 69 | +- Include vendored native sources (xxhash/blake3) in the npm tarball so iOS builds from npm no longer fail with `xxhash.h file not found`. |
| 70 | + |
| 71 | +Notes |
| 72 | + |
| 73 | +- After clone from git: `git submodule update --init --recursive`. |
| 74 | + |
| 75 | +--- |
| 76 | + |
| 77 | +## v1.1.1 – bundle native sources (XXH3/BLAKE3, HMAC/keyed) |
| 78 | + |
| 79 | +## Fix |
| 80 | + |
| 81 | +- Bundled native sources (xxhash/blake3) in the npm package so iOS builds no longer fail with `xxhash.h file not found` and the TurboModule registers correctly. |
| 82 | + |
| 83 | +## Reminder (from 1.1.0) |
| 84 | + |
| 85 | +- Native **XXH3-64/XXH3-128** and **BLAKE3** on iOS/Android. |
| 86 | +- `hashString(text, algorithm, encoding?, options?)` for small payloads (utf8/base64); for real files use `fileHash` (streams from disk). |
| 87 | +- Modes in `fileHash`/`hashString`: `hash` / `hmac` (SHA-224/256/384/512) / `keyed` (BLAKE3, 32-byte key utf8/hex/base64). |
| 88 | +- XXH3-128 output matches official xxHash order (low64 → high64). |
| 89 | +- Example app: hash file/string, switch modes, test utf8/hex/base64 keys. Migrated to `create-react-native-library` template (TurboModule, new/old arch). |
| 90 | +- README: algorithm table, output lengths, thread-safety note, submodule reminder. |
| 91 | + |
| 92 | +## Notes |
| 93 | + |
| 94 | +- After clone: `git submodule update --init --recursive`. |
| 95 | +- Tests: `yarn test`. |
| 96 | + |
| 97 | +--- |
| 98 | + |
| 99 | +## v1.1.0 – XXH3 & BLAKE3, hashString, HMAC/keyed modes |
| 100 | + |
| 101 | +- **What’s new** |
| 102 | + |
| 103 | + - Added native **XXH3-64/XXH3-128** and **BLAKE3** on iOS/Android. |
| 104 | + - New `hashString(text, algorithm, encoding?, options?)` for **small payloads**. Supports `utf8` and `base64` input. For real files always prefer `fileHash`, which streams data from disk. |
| 105 | + - Modes supported in `fileHash` and `hashString`: `hash` / `hmac` / `keyed` |
| 106 | + - **HMAC** — SHA-224/256/384/512 only. |
| 107 | + - **Keyed** — BLAKE3 only, 32-byte key (`utf8` / `hex` / `base64`). |
| 108 | + - **XXH3-128** output matches the official xxHash order (low64 → high64) on both platforms. |
| 109 | + |
| 110 | +- **Example & scaffolding** |
| 111 | + |
| 112 | + - New example app: hash files or small strings, switch modes (`hash` / `hmac` / `keyed`), and try `utf8` / `hex` / `base64` keys. |
| 113 | + - Project migrated to the `create-react-native-library` template (TurboModule, supports new/old architecture). |
| 114 | + - README: algorithm table and output lengths, thread-safety note, reminder about submodules. |
| 115 | + |
| 116 | +- **Notes** |
| 117 | + - After clone: `git submodule update --init --recursive`. |
| 118 | + - Tests: `yarn test`. |
| 119 | + |
| 120 | +--- |
| 121 | + |
| 122 | +## v1.0.5 — Full hash suite, Android coroutines, iOS performance |
| 123 | + |
| 124 | +- Highlights |
| 125 | + |
| 126 | + - Adds MD5, SHA‑1, SHA‑224, SHA‑256, SHA‑384, SHA‑512 across Android and iOS. |
| 127 | + - Faster async: Android coroutines; iOS OperationQueue + 64 KiB chunks. |
| 128 | + - README updated; CI now publishes only to npmjs.com. |
| 129 | + |
| 130 | +- Android |
| 131 | + |
| 132 | + - Migrated to Kotlin coroutines with lifecycle-aware cancel in `invalidate()`. |
| 133 | + - Supports `file://`, `content://`, and plain paths; 64 KiB buffer for large files. |
| 134 | + - Explicit mapping to JCA names; unsupported → `E_UNSUPPORTED_ALGORITHM`. |
| 135 | + |
| 136 | +- iOS |
| 137 | + |
| 138 | + - Uses `OperationQueue` (`maxConcurrentOperationCount = 2`) and 64 KiB chunked reads. |
| 139 | + - SHA‑224 via CommonCrypto (CryptoKit doesn’t provide SHA‑224). |
| 140 | + - Thin Obj‑C extern (`RCT_EXTERN_MODULE`) kept for Old/New Arch robustness. |
| 141 | + |
| 142 | +- JS/Types |
| 143 | + |
| 144 | + - `THashAlgorithm`: `'MD5' | 'SHA-1' | 'SHA-224' | 'SHA-256' | 'SHA-384' | 'SHA-512'` (default `'SHA-256'`). |
| 145 | + |
| 146 | +- Docs/CI |
| 147 | + |
| 148 | + - README documents all algorithms and examples. |
| 149 | + - Publishing to GitHub Packages removed to avoid registry conflicts. |
| 150 | + |
| 151 | +- Breaking changes |
| 152 | + |
| 153 | + - None expected. Public API unchanged; types widened to include more algorithms. |
| 154 | + |
| 155 | +- Upgrade notes |
| 156 | + - If `.npmrc` points `@preeternal` to GitHub Packages, switch to npmjs.com. |
| 157 | + - iOS: run `pod install` after upgrading. |
| 158 | + - Android: ensure `kotlinx-coroutines-android` is available in your build. |
| 159 | + |
| 160 | +--- |
| 161 | + |
| 162 | +## v1.0.4 |
| 163 | + |
| 164 | +- Fixed compatibility with React Native New Architecture (TurboModules) on Android. |
| 165 | +- Now the library works seamlessly with both legacy and new architectures. |
| 166 | +- Improved module registration and codegen integration for Android. |
| 167 | +- Minor internal refactoring. |
| 168 | + **Full Changelog**: https://github.com/Preeternal/react-native-file-hash/compare/v1.0.2...v1.0.4 |
| 169 | + |
| 170 | +--- |
| 171 | + |
| 172 | +## Initial Public Release |
| 173 | + |
| 174 | +This is the first stable release of `@preeternal/react-native-file-hash`. |
| 175 | + |
| 176 | +A high-performance native utility for calculating file hashes (MD5 and SHA-256) in React Native applications. |
| 177 | + |
| 178 | +### Features |
| 179 | + |
| 180 | +- ✅ **Native Performance:** All hashing operations are performed in native code (Swift & Kotlin) for maximum speed. |
| 181 | +- ✅ **Memory Efficient:** Files are processed in chunks, meaning even very large files can be hashed without loading them entirely into memory. |
| 182 | +- ✅ **No UI Freezes:** Hashing is done on a background thread, ensuring a smooth user experience. |
| 183 | +- ✅ **Simple API:** A single function `fileHash(filePath, algorithm)` to handle all operations. |
| 184 | +- ✅ **Modern Architecture:** Supports both the old and new React Native architectures (TurboModule-ready). |
0 commit comments