Skip to content

Commit 896cdaf

Browse files
committed
fixed entropy stuff
1 parent 65ad242 commit 896cdaf

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

df.go

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,17 +45,19 @@ func (f *Fingerprinter) getSuperCookies() string {
4545
}
4646

4747
func (f *Fingerprinter) getEntropy() string {
48-
// Idk what's that is supposed to do exactly, in this place useragent is already hashed, so it doesn't really check anything.
48+
mobile := []string{"iPad", "iPhone", "iPod"}
4949

50-
// mobile := []string{"iPad", "iPhone", "iPod"}
51-
// if slices.Contains(mobile, f.userAgent) {
52-
// return "20"
53-
// }
50+
for _, mobileString := range mobile {
51+
if strings.Contains(strings.ToLower(f.UserAgentString), strings.ToLower(mobileString)) {
52+
return "20"
53+
}
54+
}
5455

5556
return "40"
5657
}
5758

5859
func (f *Fingerprinter) GenerateFingerPrint() string {
60+
entropy := f.getEntropy()
5961
plugins := f.calculateMd5(f.PluginsString, f.Plugins)
6062
nrOfPlugins := f.padString(fmt.Sprint(f.PluginCount), f.NrOfPlugins)
6163
fonts := f.padString("", f.Fonts)
@@ -72,7 +74,6 @@ func (f *Fingerprinter) GenerateFingerPrint() string {
7274
doNotTrack := f.calculateMd5(f.DoNotTrackString, f.DoNotTrack)
7375
jsFonts := "iZCqnI4lsk"
7476
webglFp := "fKkhnraRhX"
75-
entropy := f.getEntropy()
7677

7778
if f.Verbose {
7879
fmt.Printf("plugins: %v\n", plugins)

0 commit comments

Comments
 (0)