validate

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsAlphabet

func IsAlphabet(s, allowed string) bool

IsAlphabet returns true if all characters in s are in allowed set.

func IsBase32Std

func IsBase32Std(s string) bool

IsBase32Std reports whether s is valid base32 (padding optional).

func IsBase64Std

func IsBase64Std(s string) bool

IsBase64Std reports whether s is valid standard base64 (padding optional).

func IsBase64URLNoPad

func IsBase64URLNoPad(s string) bool

IsBase64URLNoPad reports whether s is valid base64url (no padding) for JWT segments.

func IsHex

func IsHex(s string) bool

IsHex returns true if s is valid hex.

func IsJWTStructure

func IsJWTStructure(s string) bool

IsJWTStructure verifies 3 segments base64url-decodable for header and payload.

func LengthBetween

func LengthBetween(s string, min, max int) bool

LengthBetween returns true if n is within [min,max].

func LooksLikeAWSAccessKey

func LooksLikeAWSAccessKey(s string) bool

LooksLikeAWSAccessKey checks for AKIA/ASIA + 16 uppercase alnum.

func LooksLikeAWSSecretKey

func LooksLikeAWSSecretKey(s string) bool

LooksLikeAWSSecretKey checks base64-like alphabet and exact length 40.

func LooksLikeGitHubToken

func LooksLikeGitHubToken(s string) bool

LooksLikeGitHubToken performs simple validation on a GitHub token candidate. Accepts ghp_, gho_, ghu_, ghs_, ghr_ followed by 36 base62 chars.

func LooksLikeOpenAIKey

func LooksLikeOpenAIKey(s string) bool

LooksLikeOpenAIKey checks sk- prefix and reasonable alphabet/length.

Types

This section is empty.

Jump to

Keyboard shortcuts

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