opensubtitles_hasher 1.0.0
opensubtitles_hasher: ^1.0.0 copied to clipboard
Fast, cross-platform OpenSubtitles hashing. Reads only 128 KB regardless of file size. Uses native code on Android for zero-copy content URI access.
Changelog #
1.0.0 #
Initial release of opensubtitles_hasher.
Features #
OpenSubtitlesHasher.computeHash(path)— async hashing from a file pathOpenSubtitlesHasher.computeHashSync(path)— synchronous hashing for non-async contextsOpenSubtitlesHasher.computeFileHash(file)— hash from adart:ioFileobjectOpenSubtitlesHasher.computeHashResult(path)— single call returning both hash and file sizeOpenSubtitlesHasher.isValidHash(hash)— validate OpenSubtitles hash formatHashResult.toApiMap()— produces{moviehash, moviebytesize}for REST API calls
Android #
- Native Kotlin plugin for zero-copy hashing from
content://URIs - File size retrieval via
ContentResolverwithout opening the file - Persistable URI permission handling for long-lived access
- Built-in
pickMovieactivity for native file selection
Performance #
- Reads only 128 KB per file (first and last 64 KB) regardless of file size
- Uses
RandomAccessFile— no full file loading into memory - 64-bit arithmetic implemented with two 32-bit halves for precision
Quality #
- 100% null-safe (Dart 3)
- Zero runtime dependencies
- 12 unit tests covering determinism, edge cases, and validation
flutter testandflutter pub publish --dry-runpass cleanly