func confirmEntropy(thisMatch string, iSessionEntropy float64) bool {
	bResult := false
	iEntropy := getEntropyInt(thisMatch)
	if (iSessionEntropy == 0) || (iEntropy >= iSessionEntropy) {
		if !IsSafeText(&thisMatch) {
			bResult = true
		}
	}
	return bResult
}
confirmEntropy will determine correct entrophy of the string and decide if we move forward with the match
package core
import (
	"fmt"
	"gopkg.in/src-d/go-git.v4/plumbing/object"
	"gopkg.in/yaml.v2"
	"io/ioutil"
	"math"
	"os"
	"regexp"
	"strconv"
	"strings"
)
const (
	PartExtension = "extension"  
	PartFilename  = "filename"   
	PartPath      = "path"       
	PartContent   = "content"    
)
var Signatures []Signature
var SafeFunctionSignatures []SafeFunctionSignature
func loadSignatureSet(filename string) (SignatureConfig, error) {
	bytes, err := ioutil.ReadFile(filename)
	if err != nil {
		return SignatureConfig{}, err
	}
	var c SignatureConfig
	err = yaml.Unmarshal(bytes, &c)
	if err != nil {
		return SignatureConfig{}, err
	}
	return c, nil
}
func getEntropyInt(s string) float64 {
	m := map[rune]float64{}
	for _, r := range s {
		m[r]++
	}
	var hm float64
	for _, c := range m {
		hm += c * math.Log2(c)
	}
	l := float64(len(s))
	res := math.Log2(l) - hm/l
	return res
}
type Signature interface {
	Description() string
	Enable() int
	ExtractMatch(file MatchFile, sess *Session, change *object.Change) (bool, map[string]int)
	ConfidenceLevel() int
	Part() string
	SignatureID() string  
}
type SignaturesMetaData struct {
	Date    string
	Time    int
	Version string
}
type SafeFunctionSignature struct {
	comment         string
	description     string
	enable          int
	entropy         float64
	match           *regexp.Regexp
	confidenceLevel int
	part            string
	signatureid     string
}
type SimpleSignature struct {
	comment         string
	description     string
	enable          int
	entropy         float64
	match           string
	confidenceLevel int
	part            string
	signatureid     string
}
type PatternSignature struct {
	comment         string
	description     string
	enable          int
	entropy         float64
	match           *regexp.Regexp
	confidenceLevel int
	part            string
	signatureid     string
}
type SignatureDef struct {
	Comment         string  `yaml:"comment"`
	Description     string  `yaml:"description"`
	Enable          int     `yaml:"enable"`
	Entropy         float64 `yaml:"entropy"`
	Match           string  `yaml:"match"`
	ConfidenceLevel int     `yaml:"confidence-level"`
	Part            string  `yaml:"part"`
	SignatureID     string  `yaml:"signatureid"`
}
type SignatureConfig struct {
	Meta                   SignaturesMetaData `yaml:"Meta"`
	PatternSignatures      []SignatureDef     `yaml:"PatternSignatures"`
	SimpleSignatures       []SignatureDef     `yaml:"SimpleSignatures"`
	SafeFunctionSignatures []SignatureDef     `yaml:"SafeFunctionSignatures"`
}
func (s SimpleSignature) ExtractMatch(file MatchFile, sess *Session, change *object.Change) (bool, map[string]int) {
	var haystack *string
	var bResult = false
	var results map[string]int
	switch s.part {
	case PartPath:
		haystack = &file.Path
		bResult = true
	case PartFilename:
		haystack = &file.Filename
		bResult = true
	case PartExtension:
		haystack = &file.Extension
		bResult = true
	default:
		return bResult, results
	}
	return s.match == *haystack, results
}
func (s SimpleSignature) Enable() int {
	return s.enable
}
func (s SimpleSignature) ConfidenceLevel() int {
	return s.confidenceLevel
}
func (s SimpleSignature) Part() string {
	return s.part
}
func (s SimpleSignature) Description() string {
	return s.description
}
func (s SimpleSignature) SignatureID() string {
	return s.signatureid
}
func IsSafeText(sMatchString *string) bool {
	bResult := false
	for _, safeSig := range SafeFunctionSignatures {
		if safeSig.match.MatchString(*sMatchString) {
			bResult = true
		}
	}
	return bResult
}