last updates?

This commit is contained in:
zach rice committed 2019-04-16 18:13:24 -05:00
1 parent 2e7325ce03
commit 7dfa3f2b48
6 files changed
+35 -38

No files matched your search

+10 -10
View File
@@ -103,16 +103,7 @@ func (rule *Rule) check(line string, commit *commitInfo) (*Leak, error) {
}
if rule.entropies != nil {
if rule.entropyROI == "line" {
_entropy := getShannonEntropy(line)
for _, e := range rule.entropies {
if _entropy > e.v1 && _entropy < e.v2 {
entropy = _entropy
entropyWord = line
goto postEntropy
}
}
} else {
if rule.entropyROI == "word" {
words := strings.Fields(line)
for _, word := range words {
_entropy := getShannonEntropy(word)
@@ -124,6 +115,15 @@ func (rule *Rule) check(line string, commit *commitInfo) (*Leak, error) {
}
}
}
} else {
_entropy := getShannonEntropy(line)
for _, e := range rule.entropies {
if _entropy > e.v1 && _entropy < e.v2 {
entropy = _entropy
entropyWord = line
goto postEntropy
}
}
}
}