Skip to content

Commit

Permalink
refactor: remove nano package
Browse files Browse the repository at this point in the history
  • Loading branch information
geolffreym committed Apr 21, 2024
1 parent 14a8f50 commit b334fb6
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 177 deletions.
79 changes: 0 additions & 79 deletions adler32/adler32.go

This file was deleted.

93 changes: 0 additions & 93 deletions adler32/adler32_test.go

This file was deleted.

8 changes: 3 additions & 5 deletions sync/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ import (
"crypto/sha1"
"encoding/hex"
"io"

"github.com/geolffreym/rolling-sync/adler32"
)

const S = 16
Expand Down Expand Up @@ -67,7 +65,7 @@ func strong(block []byte) string {

// Calc and return weak adler32 checksum
func weak(block []byte) uint32 {
weak := adler32.New()
weak := NewAdler32()

Check failure on line 68 in sync/sync.go

View workflow job for this annotation

GitHub Actions / build

undefined: NewAdler32
return weak.Write(block).Sum()
}

Expand Down Expand Up @@ -155,7 +153,7 @@ func (s *Sync) IntegrityCheck(sig []Table, matches Delta) Delta {
// diff matches for block and the map key keep the block position.
func (s *Sync) Delta(sig []Table, reader *bufio.Reader) Delta {
// Weak checksum adler32
weak := adler32.New()
weak := NewAdler32()

Check failure on line 156 in sync/sync.go

View workflow job for this annotation

GitHub Actions / build

undefined: NewAdler32
// Delta matches
delta := make(Delta)
// Indexes for block position
Expand Down Expand Up @@ -200,7 +198,7 @@ func (s *Sync) Delta(sig []Table, reader *bufio.Reader) Delta {
delta.Add(index, newBlock) // Add new block to delta matches
// Clear garbage collectable
tmpLitMatches = tmpLitMatches[:0] // clear tmp literal matches
weak = adler32.New() // replace weak adler object
weak = NewAdler32() // replace weak adler object

Check failure on line 201 in sync/sync.go

View workflow job for this annotation

GitHub Actions / build

undefined: NewAdler32
}

}
Expand Down

0 comments on commit b334fb6

Please sign in to comment.