Documentation ¶
Overview ¶
Package asciisanitizer implements an ASCII control character sanitizer for UTF-8 strings. It will transform ASCII control codes into equivalent inert characters that are safe for display in the terminal. Without sanitization these ASCII control characters will be interpreted by the terminal. This behaviour can be used maliciously as an attack vector, especially the ASCII control characters \x1B and \x9B.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Sanitizer ¶
type Sanitizer struct { // JSON tells the Sanitizer to replace strings that will be transformed // into control characters when the string is marshaled to JSON. Set to // true if the string being sanitized represents JSON formatted data. JSON bool // contains filtered or unexported fields }
Sanitizer implements transform.Transformer interface.
func (*Sanitizer) Reset ¶
func (t *Sanitizer) Reset()
Reset resets the state and allows the Sanitizer to be reused.
Click to show internal directories.
Click to hide internal directories.