internal library

Shared plumbing for the minted_* siblings. Not public API: no semver promise, and a consumer importing it is on their own.

Dart privacy is library-scoped, so anything 2 siblings share has to be importable to be shared at all.

Siblings resolve against any minted 3.x, so this is frozen within a major. Adding is fine, breaking waits for the next core major.

Constants

hexDigitsPerByte → const int
How many hex digits spell one byte.
hexRadix → const int
The radix hex is written in.
hyphen → const String
The hyphen a canonical form puts back after parsing, where the standard fixes its position.
zeroPad → const String
The character a fixed-width field is left-padded with.

Properties

cosmeticSeparators RegExp
Whitespace and hyphens, the separators a standard treats as cosmetic grouping, for a value whose charset excludes both.
final
digitsOnly RegExp
A whole string of nothing but decimal digits.
final
whitespace RegExp
Whitespace alone, for a charset of A-Z0-9, where a hyphen is invalid rather than cosmetic.
final

Functions

compact(String input) String
input with its cosmetic grouping stripped, for a digits-only charset where upper-casing would do nothing.
compactUpperCase(String input) String
input compacted and upper-cased, for a charset that admits letters too.
decimalCodeUnit(int digitValue) int
The ASCII code unit spelling digitValue, the inverse of decimalValue. Assumes 0-9, which is what a validated digit sequence holds.
decimalValue(int codeUnit) int
The value of a single decimal character, 0-9. Anything else gives -1, so a number built out of junk fails validation downstream instead of throwing here.
decimalValues(String input, [int start = 0, int? end]) List<int>
The values of input's characters from start to end (exclusive, the whole string when omitted), ready for Digits.tryFrom.
hexBytes(String hex) Uint8List
The bytes hex spells, 2 digits per byte.
hexDigits(Iterable<int> bytes) String
bytes as lowercase hex, 2 digits each. The inverse of hexBytes.
luhnCheckDigit(String bodyDigits) String
The ISO/IEC 7812-1 Annex B (Luhn) mod-10 check digit for bodyDigits, everything before a card number's last digit. Assumed separator-free.
positiveZeroed(double value) double
value with a negative zero's sign cleared. -0.0 already equals 0.0 and hashes alike, so it's only the rendered form that needs this.
unspacedUpperCase(String input) String
input with whitespace alone stripped, then upper-cased, for a charset where a hyphen is invalid rather than cosmetic.