github.com/sean-/go@v0.0.0-20151219100004-97f854cd7bb6/src/hash/crc32/crc32_generic.go (about) 1 // Copyright 2011 The Go Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style 3 // license that can be found in the LICENSE file. 4 5 // +build 386 arm arm64 mips64 mips64le ppc64 ppc64le 6 7 package crc32 8 9 // The file contains the generic version of updateCastagnoli which just calls 10 // the software implementation. 11 12 func updateCastagnoli(crc uint32, p []byte) uint32 { 13 return update(crc, castagnoliTable, p) 14 } 15 16 func updateIEEE(crc uint32, p []byte) uint32 { 17 // only use slicing-by-8 when input is >= 4KB 18 if len(p) >= 4096 { 19 ieeeTable8Once.Do(func() { 20 ieeeTable8 = makeTable8(IEEE) 21 }) 22 return updateSlicingBy8(crc, ieeeTable8, p) 23 } 24 return update(crc, IEEETable, p) 25 }