Remove donut_gen binary and update crc32c function

This commit is contained in:
Harshavardhana
2015-02-27 14:41:17 -08:00
parent 9aea7fd97b
commit 3f8b3462e6
5 changed files with 8 additions and 11 deletions

View File

@@ -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
}