Öffentliche Dateiansicht: Raw-Dateien, Tree, Releases und Issues sind ohne Login verfügbar.
internal/detector/socialsecurity.go Raw
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
package detector

import "regexp"

var svnRE = regexp.MustCompile(`\b\d{2} ?\d{6} ?[A-Z] ?\d{3}\b`)

func detectSocialSecurity(text string) []Finding {
	var out []Finding
	for _, loc := range svnRE.FindAllStringIndex(text, -1) {
		out = append(out, Finding{
			Type: PiiSocialSec, Start: loc[0], End: loc[1],
			Text: text[loc[0]:loc[1]], Confidence: 0.9,
		})
	}
	return out
}