Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 4 of 4 for NewIEEE (0.07 sec)

  1. src/hash/crc32/crc32.go

    	}
    	return &digest{0, tab}
    }
    
    // NewIEEE creates a new [hash.Hash32] computing the CRC-32 checksum using
    // the [IEEE] polynomial. Its Sum method will lay the value out in
    // big-endian byte order. The returned Hash32 also implements
    // [encoding.BinaryMarshaler] and [encoding.BinaryUnmarshaler] to marshal
    // and unmarshal the internal state of the hash.
    func NewIEEE() hash.Hash32 { return New(IEEETable) }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Sun May 12 05:36:29 UTC 2024
    - 7.5K bytes
    - Viewed (0)
  2. src/hash/crc32/crc32_test.go

    func TestCastagnoliRace(t *testing.T) {
    	// The MakeTable(Castagnoli) lazily initializes castagnoliTable,
    	// which races with the switch on tab during Write to check
    	// whether tab == castagnoliTable.
    	ieee := NewIEEE()
    	go MakeTable(Castagnoli)
    	ieee.Write([]byte("hello"))
    }
    
    type test struct {
    	ieee, castagnoli    uint32
    	in                  string
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Jun 03 14:56:25 UTC 2024
    - 12.1K bytes
    - Viewed (0)
  3. internal/ringbuffer/ring_buffer_test.go

    	defer timeout(60 * time.Second)()
    	const debug = false
    
    	var readBytes int
    	var wroteBytes int
    	var readBuf bytes.Buffer
    	var wroteBuf bytes.Buffer
    	readHash := crc32.NewIEEE()
    	wroteHash := crc32.NewIEEE()
    	read := io.Writer(readHash)
    	wrote := io.Writer(wroteHash)
    	if debug {
    		read = io.MultiWriter(read, &readBuf)
    		wrote = io.MultiWriter(wrote, &wroteBuf)
    	}
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Wed May 15 00:11:04 UTC 2024
    - 26.8K bytes
    - Viewed (0)
  4. internal/hash/checksum.go

    }
    
    // Hasher returns a hasher corresponding to the checksum type.
    // Returns nil if no checksum.
    func (c ChecksumType) Hasher() hash.Hash {
    	switch {
    	case c.Is(ChecksumCRC32):
    		return crc32.NewIEEE()
    	case c.Is(ChecksumCRC32C):
    		return crc32.New(crc32.MakeTable(crc32.Castagnoli))
    	case c.Is(ChecksumSHA1):
    		return sha1.New()
    	case c.Is(ChecksumSHA256):
    		return sha256.New()
    	}
    	return nil
    }
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Wed May 08 16:18:34 UTC 2024
    - 12.6K bytes
    - Viewed (0)
Back to top