Documentation
¶
Overview ¶
Package ints is an optimised encoder for decimal numbers in ASCII format, that simplifies and accelerates encoding and decoding decimal strings. It is faster than strconv in part because it uses a base of 10000 and a lookup table.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type T ¶
type T struct {
N uint64
}
T is an integer with a fast codec to decimal ASCII.
func New ¶
func New[V constraints.Integer](n V) *T
func (*T) Unmarshal ¶
Unmarshal reads a string, which must be a positive integer no larger than math.MaxUint64, skipping any non-numeric content before it.
Note that leading zeros are not considered valid, but basically no such thing as machine generated JSON integers with leading zeroes. Until this is disproven, this is the fastest way to read a positive json integer, and a leading zero is decoded as a zero, and the remainder returned.