IntUtils class

Utility class for integer-related operations and conversions.

Constructors

IntUtils()

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Properties

pi → double
no setter

Static Methods

bitlengthInBytes(int val) → int
Calculates the number of bytes required to represent the bit length of an integer value.
cos(num x) → double
ctSelectBool(bool a, bool b, bool choice) → bool
ctSelectInt(int a, int b, bool choice) → int
decodeVarint(List<int> byteint) → (int, int)
Decodes a variable-length byte array into an integer value according to Bitcoin's variable-length integer encoding scheme.
encodeVarint(int value) → List<int>
Encodes an integer into a variable-length byte array according to Bitcoin's variable-length integer encoding scheme.
exp(num x) → double
fromBytes(List<int> bytes, {Endian byteOrder = Endian.big, bool sign = false}) → int
Converts a list of bytes to an integer, following the specified byte order.
log(num x) → double
max(int a, int b) → int
min(int a, int b) → int
parse(dynamic number, {bool allowHex = true}) → int
Parses a dynamic value number into an integer.
pow(num x, num exponent) → num
prependVarint(List<int> data) → List<int>
Prepends a variable-length integer encoding of the given data length to the provided data.
sqrt(num x) → double
toBinaryBool(int value, {int? bitLength}) → List<bool>
toBytes(int val, {int? length, Endian byteOrder = Endian.big}) → List<int>
Converts an integer to a byte list with the specified length and endianness.
tryParse(dynamic number, {bool allowHex = true}) → int?
Tries to parse a dynamic value number into an integer, returning null if parsing fails.