parseHex static method
Implementation
static Uint256 parseHex(String s) {
var hex = (s.startsWith('0x') || s.startsWith('0X')) ? s.substring(2) : s;
if (hex.isEmpty || hex.length > 64) {
throw ArgumentException.invalidOperationArguments(
"parseHex",
reason: 'invalid hex literal.',
details: {"value": s},
);
}
hex = hex.padLeft(64, '0');
final d3 = Uint64.parseHex('0x${hex.substring(0, 16)}');
final d2 = Uint64.parseHex('0x${hex.substring(16, 32)}');
final d1 = Uint64.parseHex('0x${hex.substring(32, 48)}');
final d0 = Uint64.parseHex('0x${hex.substring(48, 64)}');
return Uint256._(d3, d2, d1, d0);
}