BigInt toBigInt({bool littleEndian = true}) { var buf = littleEndian ? reversed : this; var asHex = hex.encode(buf.toList()); return BigInt.parse(asHex, radix: 16); }