Cas.parse constructor
Cas.parse(
- String value
Implementation
factory Cas.parse(String value) {
Never throwFormatException() =>
throw FormatException('Invalid CAS string value', value);
if (value.length != 18 || !value.startsWith('0x')) {
throwFormatException();
}
try {
final hexDigits = value.substring(2);
final higher = int.parse(hexDigits.substring(0, 8), radix: 16);
final lower = int.parse(hexDigits.substring(8), radix: 16);
return Cas._(higher << 32 | lower);
} on FormatException {
throwFormatException();
}
}