- Sort Score
- Result 10 results
- Languages All
Results 1 - 2 of 2 for randByteOrder (0.76 sec)
-
src/internal/fuzz/mutators_byteslice.go
func byteSliceArithmeticUint16(m *mutator, b []byte) []byte { if len(b) < 2 { return nil } v := uint16(m.rand(35) + 1) if m.r.bool() { v = 0 - v } pos := m.rand(len(b) - 1) enc := m.randByteOrder() enc.PutUint16(b[pos:], enc.Uint16(b[pos:])+v) return b } // byteSliceArithmeticUint32 adds/subtracts from a random uint32 in b. func byteSliceArithmeticUint32(m *mutator, b []byte) []byte {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri Nov 19 18:23:43 UTC 2021 - 7.7K bytes - Viewed (0) -
src/internal/fuzz/mutator.go
} func newMutator() *mutator { return &mutator{r: newPcgRand()} } func (m *mutator) rand(n int) int { return m.r.intn(n) } func (m *mutator) randByteOrder() binary.ByteOrder { if m.r.bool() { return binary.LittleEndian } return binary.BigEndian } // chooseLen chooses length of range mutation in range [1,n]. It gives // preference to shorter ranges.
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Sep 18 20:01:34 UTC 2023 - 6.6K bytes - Viewed (0)