components/flutterstart_core/src/hashing/hashing library
Classes
- HashResult
- A sealed result representing the outcome of a hashing operation.
- InvalidUtf8Result
- Result returned when a file expected to be text contains invalid UTF-8.
- SuccessfulHash
- Successful hashing result containing raw and normalized hashes.
Functions
-
computeRawHash(
List< int> bytes) → String - Computes the raw SHA-256 hash of the exact bytes.
-
hashBytes(
List< int> bytes, {bool? isBinary}) → HashResult - Computes hash values for the given bytes.
-
isBinaryContent(
List< int> bytes) → bool - Helper to detect if a byte array represents binary content.
-
normalizeLineEndings(
String text) → String - Folds CRLF (\r\n) and lone CR (\r) into LF (\n).
Exceptions / Errors
- InvalidUtf8
- Exception thrown when invalid UTF-8 content is encountered.