init 0.2.0 work

This commit is contained in:
zricethezav committed 2018-02-24 15:46:24 -06:00
1 parent c11171f47d
commit 1b06f1a0dc
7 files changed
+307 -180

No files matched your search

+3 -3
View File
@@ -6,7 +6,7 @@ import (
)
// checks Regex and if enabled, entropy and stopwords
func doChecks(diff string, commit string) []LeakElem {
func doChecks(diff string, commit string, opts *Options) []LeakElem {
var match string
var leaks []LeakElem
var leak LeakElem
@@ -16,7 +16,7 @@ func doChecks(diff string, commit string) []LeakElem {
match = re.FindString(line)
if len(match) == 0 ||
(opts.Strict && containsStopWords(line)) ||
(opts.Entropy && !checkShannonEntropy(line)) {
(opts.Entropy && !checkShannonEntropy(line, opts)) {
continue
}
@@ -35,7 +35,7 @@ func doChecks(diff string, commit string) []LeakElem {
}
// checkShannonEntropy checks entropy of target
func checkShannonEntropy(target string) bool {
func checkShannonEntropy(target string, opts *Options) bool {
var (
sum float64
targetBase64Len int