guardtext

package
v1.30.1 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CollapseWhitespace

func CollapseWhitespace(text string) string

func ComposeJamoSequences

func ComposeJamoSequences(text string) string

func ContainsSuspiciousBase64

func ContainsSuspiciousBase64(input string) bool

func DecodeBase64Candidate

func DecodeBase64Candidate(input string) ([]byte, error)

func DecodedCandidateFitsBudget added in v1.30.1

func DecodedCandidateFitsBudget(candidate string) bool

DecodedCandidateFitsBudget은 단일 decode candidate가 admission 크기 한도 안에 있는지 보고한다.

func EncodingSyntaxNeedsNormalization added in v1.30.1

func EncodingSyntaxNeedsNormalization(text string) bool

func IsReadableText

func IsReadableText(data []byte) bool

func JoinShortSeparators

func JoinShortSeparators(text string, maxRun int) string

func Normalize

func Normalize(text string) string

func NormalizeASCIIByteReplacement added in v1.30.1

func NormalizeASCIIByteReplacement(value byte) (string, bool)

func NormalizeEncodingSyntax added in v1.30.1

func NormalizeEncodingSyntax(text string) string

NormalizeEncodingSyntax는 Base64 대소문자를 보존하면서 호환 문법과 인코딩 경계의 format/control 문자를 정규화한다.

func NormalizePostProcess

func NormalizePostProcess(text string) string

func SanitizeUTF8

func SanitizeUTF8(text string) string

func StripControlChars

func StripControlChars(text string) string

func StripFormatAndCombining

func StripFormatAndCombining(text string) string

Types

type DecodeResult added in v1.30.1

type DecodeResult struct {
	Candidates []string
	Status     DecodeStatus
	// contains filtered or unexported fields
}

func DecodeCandidates

func DecodeCandidates(input string) DecodeResult

DecodeCandidates는 읽을 수 있는 지원 인코딩을 너비 우선으로 확장하고 미완료 원인을 Status에 남긴다.

func DecodeCandidatesWithContext added in v1.30.1

func DecodeCandidatesWithContext(input string) DecodeResult

DecodeCandidatesWithContext는 주변 평문을 보존한 채 지원 인코딩을 확장한다.

func DecodeCandidatesWithContextForMatching added in v1.30.1

func DecodeCandidatesWithContextForMatching(input string, mayContribute func(string) bool) DecodeResult

DecodeCandidatesWithContextForMatching은 matcher에 기여할 수 있는 긴 인코딩 구간만 주변 문맥과 함께 확장한다.

func DecodeCandidatesWithContextForProtected added in v1.30.1

func DecodeCandidatesWithContextForProtected(input string, mayContribute ...func(string) bool) DecodeResult

DecodeCandidatesWithContextForProtected는 protected text에 기여할 수 있는 짧은 Base64·hex 조각만 bounded BFS에 추가한다.

func DecodeCandidatesWithContextForRuleOwner added in v1.30.1

func DecodeCandidatesWithContextForRuleOwner[T any](input string, owner T, mayContribute func(T, string) bool) DecodeResult

DecodeCandidatesWithContextForRuleOwner avoids allocating an owner-bound callback when the input has no transform surface.

func DecodeCandidatesWithContextForRules added in v1.30.1

func DecodeCandidatesWithContextForRules(input string, mayContribute func(string) bool) DecodeResult

DecodeCandidatesWithContextForRules expands standard transforms and short Base64/hex fragments that can contribute to a compiled rule. All paths share the existing decode budgets and retain fail-closed status reporting.

func (DecodeResult) Complete added in v1.30.1

func (r DecodeResult) Complete() bool

type DecodeStatus added in v1.30.1

type DecodeStatus uint8

DecodeStatus는 제한 안에서 완료하지 못한 decode 작업을 나타낸다.

const (
	DecodeCandidateLimit DecodeStatus = 1 << iota
	DecodeByteLimit
	DecodeDepthLimit
	DecodeScanLimit
)

type Views

type Views struct {
	Raw    string
	Norm   string
	Joined string
}

func NormalizeViews

func NormalizeViews(text string) Views

Jump to

Keyboard shortcuts

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