Skip to content

Commit

Permalink
review
Browse files Browse the repository at this point in the history
  • Loading branch information
pivilartisant committed Jul 23, 2024
1 parent 700abda commit dec8857
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 40 deletions.
22 changes: 0 additions & 22 deletions int/zipper/zipper.go

This file was deleted.

22 changes: 22 additions & 0 deletions pkg/website/chunk.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package chunk

import "fmt"


func DivideChunk(data []byte, chunkSize int) ([][]byte, error) {
chunkNumber := len(data)/chunkSize + 1

if len(data) < 1 {
return nil, fmt.Errorf("data is empty")
}

var chunks [][]byte

for i := 1; i < chunkNumber; i++ {
chunks = append(chunks, data[(i-1)*chunkSize:(i)*chunkSize])
}

chunks = append(chunks, data[(chunkNumber-1)*chunkSize:])

return chunks, nil
}
18 changes: 0 additions & 18 deletions utils/chunker.go

This file was deleted.

0 comments on commit dec8857

Please sign in to comment.