Documentation
¶
Overview ¶
Package art summarizes the functions and inverse functions for mapping between a prefix and a baseIndex.
can inline HostIdx with cost 5 can inline IdxToPfx256 with cost 37 can inline IdxToRange256 with cost 61 can inline NetMask with cost 7 can inline PfxLen256 with cost 18 can inline PfxToIdx256 with cost 29 can inline pfxToIdx with cost 11
Please read the ART paper ./doc/artlookup.pdf to understand the baseIndex algorithm.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IdxToPfx256 ¶
IdxToPfx256 returns the octet and prefix len of baseIdx. It's the inverse to pfxToIdx256.
It panics on invalid input.
func IdxToRange256 ¶
IdxToRange256 returns the first and last octet of prefix idx.
func NetMask ¶
NetMask for bits
0b0000_0000, // bits == 0 0b1000_0000, // bits == 1 0b1100_0000, // bits == 2 0b1110_0000, // bits == 3 0b1111_0000, // bits == 4 0b1111_1000, // bits == 5 0b1111_1100, // bits == 6 0b1111_1110, // bits == 7 0b1111_1111, // bits == 8
func PfxToIdx256 ¶
PfxToIdx256 maps 8bit prefixes to numbers. The values range [1 .. 255]. Values > 255 are shifted by >> 1.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.