Skip to content

Commit

Permalink
use dedupe utils
Browse files Browse the repository at this point in the history
  • Loading branch information
dogancanbakir committed Oct 24, 2023
1 parent 19eb4cc commit 4d33a9b
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 138 deletions.
61 changes: 0 additions & 61 deletions dedupe.go

This file was deleted.

4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ require (
github.com/projectdiscovery/fasttemplate v0.0.2
github.com/projectdiscovery/goflags v0.1.25
github.com/projectdiscovery/gologger v1.1.11
github.com/projectdiscovery/hmap v0.0.23
github.com/projectdiscovery/utils v0.0.58
github.com/projectdiscovery/utils v0.0.59
github.com/stretchr/testify v1.8.4
golang.org/x/net v0.17.0
gopkg.in/yaml.v3 v3.0.1
Expand Down Expand Up @@ -57,6 +56,7 @@ require (
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/projectdiscovery/blackrock v0.0.1 // indirect
github.com/projectdiscovery/hmap v0.0.23 // indirect
github.com/rivo/uniseg v0.4.4 // indirect
github.com/rogpeppe/go-internal v1.10.0 // indirect
github.com/saintfish/chardet v0.0.0-20230101081208-5e3ef4b5456d // indirect
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,8 @@ github.com/projectdiscovery/gologger v1.1.11 h1:8vsz9oJlDT9euw6xlj7F7dZ6RWItVIqV
github.com/projectdiscovery/gologger v1.1.11/go.mod h1:UR2bgXl7zraOxYGnUwuO917hifWrwMJ0feKnVqMQkzY=
github.com/projectdiscovery/hmap v0.0.23 h1:tV/5gQuabE2nqDMS55vrd3HQYdwTuRJAm49nGu3DVl4=
github.com/projectdiscovery/hmap v0.0.23/go.mod h1:DYt1/UjEPA4vw6sk3PY8UB34ZnvXrDC3PQ+LBpkNlOA=
github.com/projectdiscovery/utils v0.0.58 h1:kk2AkSO84QZc9rDRI8jWA2Iia4uzb4sUcfh4h0xA20I=
github.com/projectdiscovery/utils v0.0.58/go.mod h1:rsR5Kzjrb+/Yp7JSnEblLk4LfU4zH5Z7wQn8RzaGSdY=
github.com/projectdiscovery/utils v0.0.59 h1:s5/+Nq+8B3Ngg0L8vDy2LV2BKrwhm7n43GS1yefaDOQ=
github.com/projectdiscovery/utils v0.0.59/go.mod h1:XSCKtkFYG48Fh+wA+N3/k1xdYOsdCjftVZROKBYWmUI=
github.com/rivo/uniseg v0.1.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis=
Expand Down
37 changes: 0 additions & 37 deletions internal/dedupe/leveldb.go

This file was deleted.

30 changes: 0 additions & 30 deletions internal/dedupe/map.go

This file was deleted.

8 changes: 2 additions & 6 deletions mutator.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (

"github.com/projectdiscovery/fasttemplate"
"github.com/projectdiscovery/gologger"
"github.com/projectdiscovery/utils/dedupe"
errorutil "github.com/projectdiscovery/utils/errors"
sliceutil "github.com/projectdiscovery/utils/slice"
)
Expand Down Expand Up @@ -126,7 +127,7 @@ func (m *Mutator) Execute(ctx context.Context) <-chan string {

if DedupeResults {
// drain results
d := NewDedupe(results, maxBytes)
d := dedupe.NewDedupe(results, maxBytes)
d.Drain()
return d.GetResults()
}
Expand Down Expand Up @@ -155,11 +156,6 @@ func (m *Mutator) ExecuteWithWriter(Writer io.Writer) error {
// drain all dedupers when max-file size reached
continue
}

if strings.HasPrefix(value, "-") {
continue
}

outputData := []byte(value + "\n")
if len(outputData) > maxFileSize {
maxFileSize = 0
Expand Down

0 comments on commit 4d33a9b

Please sign in to comment.