// Copyright 2011 The LevelDB-Go Authors. All rights reserved.//// Use of this source code is governed by a BSD-style license that can be// found in the LICENSE file.packageutilimport("hash/crc32")vartable=crc32.MakeTable(crc32.Castagnoli)// CRC is a CRC-32 checksum computed using Castagnoli's polynomial.typeCRCuint32// NewCRC creates a new crc based on the given bytes.funcNewCRC(b[]byte)CRC{returnCRC(0).Update(b)}// Update updates the crc with the given bytes.func(cCRC)Update(b[]byte)CRC{returnCRC(crc32.Update(uint32(c),table,b))}// Value returns a masked crc.func(cCRC)Value()uint32{returnuint32(c>>15|c<<17)+0xa282ead8}