conv

package
v0.0.0-...-2f994d5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 15, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package conv provides safe integer conversion helpers for the regex engine.

These functions perform bounds checking before narrowing integer conversions to prevent silent overflow. They panic on overflow since this indicates a programming error (e.g., regex pattern too large for internal limits).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IntToUint16

func IntToUint16(n int) uint16

IntToUint16 safely converts an int to uint16. Panics if n < 0 or n > math.MaxUint16.

func IntToUint32

func IntToUint32(n int) uint32

IntToUint32 safely converts an int to uint32. Panics if n < 0 or n > math.MaxUint32.

func Uint64ToUint16

func Uint64ToUint16(n uint64) uint16

Uint64ToUint16 safely converts a uint64 to uint16. Panics if n > math.MaxUint16.

func Uint64ToUint32

func Uint64ToUint32(n uint64) uint32

Uint64ToUint32 safely converts a uint64 to uint32. Panics if n > math.MaxUint32.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL