MCPcopy Index your code
hub / github.com/TheAlgorithms/Go / FuzzXOR

Function FuzzXOR

cipher/xor/xor_test.go:108–117  ·  view source on GitHub ↗
(f *testing.F)

Source from the content-addressed store, hash-verified

106}
107
108func FuzzXOR(f *testing.F) {
109 f.Add([]byte("The Quick Brown Fox Jumps over the Lazy Dog."), byte('X'))
110 f.Fuzz(func(t *testing.T, input []byte, key byte) {
111 cipherText := Encrypt(key, input)
112 result := Decrypt(key, cipherText)
113 if !bytes.Equal(input, result) {
114 t.Errorf("Before: %s, after: %s, key: %d", input, result, key)
115 }
116 })
117}

Callers

nothing calls this directly

Calls 3

EncryptFunction · 0.70
DecryptFunction · 0.70
AddMethod · 0.65

Tested by

no test coverage detected