diff --git a/pkg/storage/donut/v1/donut.go b/pkg/storage/donut/v1/donut.go index 7645d642b..e5452acb6 100644 --- a/pkg/storage/donut/v1/donut.go +++ b/pkg/storage/donut/v1/donut.go @@ -119,10 +119,8 @@ func (donut *Donut) WriteEnd(target io.Writer, donutFormat DonutFormat) error { if err := binary.Write(&tempBuffer, binary.LittleEndian, donutFormat.BlockEnd); err != nil { return err } - crc, err := crc32c.Crc32c(tempBuffer.Bytes()) - if err != nil { - return err - } + + crc := crc32c.Sum32(tempBuffer.Bytes()) if err := binary.Write(target, binary.LittleEndian, crc); err != nil { return err } @@ -169,10 +167,7 @@ func (donut *Donut) WriteBegin(target io.Writer, donutFormat DonutFormat) error if err := binary.Write(&headerBytes, binary.LittleEndian, donutFormat.GobHeader); err != nil { return err } - crc, err := crc32c.Crc32c(headerBytes.Bytes()) - if err != nil { - return err - } + crc := crc32c.Sum32(headerBytes.Bytes()) if err := binary.Write(&headerBytes, binary.LittleEndian, crc); err != nil { return err } diff --git a/pkg/storage/donut/v1/donut_gen_v1/.gitignore b/pkg/storage/donut/v1/donut_gen_v1/.gitignore new file mode 100644 index 000000000..fdad5246b --- /dev/null +++ b/pkg/storage/donut/v1/donut_gen_v1/.gitignore @@ -0,0 +1,2 @@ +donut_gen +hello \ No newline at end of file diff --git a/pkg/storage/donut/v1/donut_gen_v1/donut_gen b/pkg/storage/donut/v1/donut_gen_v1/donut_gen deleted file mode 100755 index 762cb19a1..000000000 Binary files a/pkg/storage/donut/v1/donut_gen_v1/donut_gen and /dev/null differ diff --git a/pkg/storage/donut/v1/donut_gen_v1/donut_gen.go b/pkg/storage/donut/v1/donut_gen_v1/donut_gen.go index dc7662a25..c6fa9ef80 100644 --- a/pkg/storage/donut/v1/donut_gen_v1/donut_gen.go +++ b/pkg/storage/donut/v1/donut_gen_v1/donut_gen.go @@ -12,7 +12,7 @@ import ( func main() { fmt.Println("--start") - file, err := os.OpenFile("newfile", os.O_WRONLY|os.O_CREATE, 0666) + file, err := os.OpenFile("hello", os.O_WRONLY|os.O_CREATE, 0666) if err != nil { panic(err) } @@ -30,10 +30,10 @@ func main() { fmt.Println("--closed") fmt.Println("--verify") - stat, _ := os.Stat("newfile") + stat, _ := os.Stat("hello") fileSize := stat.Size() - rfile, _ := os.OpenFile("newfile", os.O_RDONLY, 0666) + rfile, _ := os.OpenFile("hello", os.O_RDONLY, 0666) blockStart := make([]byte, 4) blockStartCheck := []byte{'M', 'I', 'N', 'I'} diff --git a/pkg/storage/donut/v1/donut_gen_v1/hello b/pkg/storage/donut/v1/donut_gen_v1/hello deleted file mode 100644 index e69de29bb..000000000