ContainsBinaryData checks if the provided data contains binary (non-text) content
(data []byte)
| 214 | |
| 215 | // ContainsBinaryData checks if the provided data contains binary (non-text) content |
| 216 | func ContainsBinaryData(data []byte) bool { |
| 217 | for _, b := range data { |
| 218 | if b == 0 { |
| 219 | return true |
| 220 | } |
| 221 | if b < 32 && b != 9 && b != 10 && b != 13 { |
| 222 | return true |
| 223 | } |
| 224 | } |
| 225 | return false |
| 226 | } |
no outgoing calls
no test coverage detected