🔢Uint Ranges
Overview
The UintRange
type is a fundamental component in BitBadges, representing an inclusive range of numbers from a start value to an end value. This type enables powerful range-based operations and is primarily used for badge IDs and time ranges.
Usage
Badge IDs
When transferring badges, specify an array of UintRange<number>
to indicate which badge IDs to transfer.
Example:
Time Ranges
UintRange
is also used for time-based operations, such as transferTimes
. In this context, the values represent UNIX milliseconds since the epoch.
Example:
Restrictions
Unless otherwise specified, we only allow numbers in the ranges to be from 1 to Go Max UInt64
Valid ranges: 1 to 18446744073709551615 (Go's
math.MaxUint64
)Zero and values greater than the maximum are not allowed
Special Cases
Full Range
To represent a complete range, use:
Range Inversion
Inverting a range results in all values from 1 to 18446744073709551615 that are not in the current range.
Last updated