1
0
mirror of https://github.com/golang/go synced 2024-11-18 13:44:48 -07:00
go/src/hash
Radu Berinde bdde10137b hash/crc32: cleanup code and improve tests
Major reorganization of the crc32 code:

 - The arch-specific files now implement a well-defined interface
   (documented in crc32.go). They no longer have the responsibility of
   initializing and falling back to a non-accelerated implementation;
   instead, that happens in the higher level code.

 - The non-accelerated algorithms are moved to a separate file with no
   dependencies on other code.

 - The "cutoff" optimization for slicing-by-8 is moved inside the
   algorithm itself (as opposed to every callsite).

Tests are significantly improved:
 - direct tests for the non-accelerated algorithms.
 - "cross-check" tests for arch-specific implementations (all archs).
 - tests for misaligned buffers for both IEEE and Castagnoli.

Fixes #16909.

Change-Id: I9b6dd83b7a57cd615eae901c0a6d61c6b8091c74
Reviewed-on: https://go-review.googlesource.com/27935
Reviewed-by: Keith Randall <khr@golang.org>
2016-08-31 15:17:57 +00:00
..
adler32 hash/adler32: Unroll loop for extra performance. 2016-04-15 10:17:17 +00:00
crc32 hash/crc32: cleanup code and improve tests 2016-08-31 15:17:57 +00:00
crc64 hash/crc64: Use slicing by 8. 2016-05-18 14:38:04 +00:00
fnv
hash.go
test_cases.txt
test_gen.awk