/
githubmirror
/
gitleaks
Обзор
Документация
Войти
/
githubmirror
/
gitleaks
Код
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
detect/codec/ascii.go
34 строки
683 B
bplaxco
Percent/URL Decoding Support (#1831)
12 май 2025, 19:22
Не верифицирован
12 май 2025, 19:22
78eebac
Код
Авторство
О чём код?
package codec var printableASCII [256]bool func init() { for b := 0; b < len(printableASCII); b++ { if '\x08' < b && b < '\x7f' { printableASCII[b] = true } } } // isPrintableASCII returns true if all bytes are printable ASCII func isPrintableASCII(b []byte) bool { for _, c := range b { if !printableASCII[c] { return false } } return true } // hasByte can be used to check if a string has at least one of the provided // bytes. Note: make sure byteset is long enough to handle the largest byte in // the string. func hasByte(data string, byteset []bool) bool { for i := 0; i < len(data); i++ { if byteset[data[i]] { return true } } return false }