mirror of
https://github.com/pgsty/minio.git
synced 2026-08-09 15:53:28 +03:00
Fast CRC implementations ported from Intel's efforts
Provides fast CRC32C with PCLMULQDQ instructions in Golang The white papers on CRC32C calculations with PCLMULQDQ instruction can be downloaded from: http://www.intel.com/content/dam/www/public/us/en/documents/white-papers/crc-iscsi-polynomial-crc32-instruction-paper.pdf http://www.intel.com/content/dam/www/public/us/en/documents/white-papers/fast-crc-computation-paper.pdf
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
package crc32c
|
||||
|
||||
import (
|
||||
. "gopkg.in/check.v1"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func Test(t *testing.T) { TestingT(t) }
|
||||
|
||||
type MySuite struct{}
|
||||
|
||||
var _ = Suite(&MySuite{})
|
||||
|
||||
func (s *MySuite) TestCrc32c(c *C) {
|
||||
data_1 := []byte("Lorem Ipsum is simply dummy text of the printing and typesetting industry")
|
||||
crc, err := Crc32c(data_1)
|
||||
c.Assert(err, IsNil)
|
||||
|
||||
data_2 := []byte("Lorem Ipsum is simply dummy text of the printing and typesetting industry")
|
||||
newcrc, newerr := Crc32c(data_2)
|
||||
c.Assert(newerr, IsNil)
|
||||
|
||||
c.Assert(crc, Equals, newcrc)
|
||||
}
|
||||
Reference in New Issue
Block a user