Internal

internal/bytepolicy

import "github.com/gofiber/fiber/v3/internal/bytepolicy"

Package bytepolicy defines which bytes the control-character checks of BasicAuth, request IDs and quoted strings reject. Each policy has a word mask that marks, on bit 7, every lane of an 8-byte word it rejects, and a byte predicate for the scalar tail. Each caller keeps its own scan loop around them: a shared index function cost up to 1.8x on arm64.

Functions

func IsNonVisibleASCII(c byte) bool

Source: internal/bytepolicy/bytepolicy.go:18

IsNonVisibleASCII reports whether c is outside visible ASCII [0x20, 0x7E].

func IsNonVisibleASCIIOrTab(c byte) bool

Source: internal/bytepolicy/bytepolicy.go:29

IsNonVisibleASCIIOrTab reports whether c is neither visible ASCII nor HTAB.

func IsQuotedStringEscape(c byte) bool

Source: internal/bytepolicy/bytepolicy.go:41

IsQuotedStringEscape reports whether quotedstring.Escape rewrites c.

func NonVisibleASCIIMask(w uint64) uint64

Source: internal/bytepolicy/bytepolicy.go:13

NonVisibleASCIIMask marks the lanes of w outside visible ASCII [0x20, 0x7E].

func NonVisibleASCIIOrTabMask(w uint64) uint64

Source: internal/bytepolicy/bytepolicy.go:24

NonVisibleASCIIOrTabMask marks the lanes of w that are neither visible ASCII nor HTAB. Bytes >= 0x80 are marked, although RFC 9110 field values allow them.

func QuotedStringEscapeMask(w uint64) uint64

Source: internal/bytepolicy/bytepolicy.go:35

QuotedStringEscapeMask marks the lanes of w holding a byte quotedstring.Escape rewrites: '\\', '"', any C0 control (HTAB included) or DEL. Bytes >= 0x80 pass.