Documentation
¶
Index ¶
- func ClampUint32ToUint16(v uint32) uint16
- func DecodeState(state string) (prefix string, nonce string, err error)
- func EncodeState(prefix, nonce string) string
- func SafeIntToInt32(v int) int32
- func SafeIntToUint16(v int) uint16
- func SafeIntToUint32(v int) uint32
- func SafeIntToUint64(v int) uint64
- func Safeu32ToInt(v uint32) int
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClampUint32ToUint16 ¶
ClampUint32ToUint16 safely converts uint32 to uint16, clamping to 65535 if overflow.
func DecodeState ¶
decodeState parses a base64url-encoded state string back to prefix and nonce.
func EncodeState ¶
encodeState builds a base64url-encoded state string as "prefix:nonce".
func SafeIntToInt32 ¶
SafeIntToInt32 converts int to int32, clamping to int32 max/min.
func SafeIntToUint16 ¶
SafeIntToUint16 safely converts int to uint16, clamping to 0-65535.
func SafeIntToUint32 ¶
SafeIntToUint32 converts int to uint32, clamping negative values to 0.
func SafeIntToUint64 ¶
SafeIntToUint64 converts int to uint64, assuming non-negative input (e.g., from Read()).
func Safeu32ToInt ¶
Safeu32ToInt converts uint32 to int, returning 0 if overflow would occur.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.