mirror of
https://github.com/trufflesecurity/trufflehog.git
synced 2024-11-13 00:17:18 +00:00
Update comment
This commit is contained in:
parent
304b753a2f
commit
b6ed83fe0d
1 changed files with 6 additions and 3 deletions
|
@ -78,7 +78,7 @@ func (d *Base64) FromChunk(chunk *sources.Chunk) *DecodableChunk {
|
|||
return positionMap[sortedSubstrings[i]] < positionMap[sortedSubstrings[j]]
|
||||
})
|
||||
|
||||
// Process in order.
|
||||
// Process in sequential order.
|
||||
for _, encoded := range sortedSubstrings {
|
||||
if decoded, ok := decodedSubstrings[encoded]; ok {
|
||||
pos := positionMap[encoded]
|
||||
|
@ -112,8 +112,11 @@ func getSubstringsOfCharacterSet(data []byte, threshold int, charsetMapping [128
|
|||
return nil
|
||||
}
|
||||
|
||||
// Start with a reasonable capacity.
|
||||
substrings := make([]string, 0, 16)
|
||||
// initialSubstringsCapacity is set to 16 as a practical optimization,
|
||||
// balancing memory usage with the typical number of base64-encoded
|
||||
// strings found in common input data. (this could be tuned further)
|
||||
const initialSubstringsCapacity = 16
|
||||
substrings := make([]string, 0, initialSubstringsCapacity)
|
||||
|
||||
count := 0
|
||||
start := 0
|
||||
|
|
Loading…
Reference in a new issue