-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathfuzz.go
55 lines (39 loc) · 1.16 KB
/
fuzz.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
//go:build gofuzz
// +build gofuzz
package branca
// ////////////////////////////////////////////////////////////////////////////////// //
// //
// Copyright (c) 2023 ESSENTIAL KAOS //
// MIT License <https://opensource.org/licenses/MIT> //
// //
// ////////////////////////////////////////////////////////////////////////////////// //
var b, _ = NewBranca([]byte("abcdefghabcdefghabcdefghabcdefgh"))
// ////////////////////////////////////////////////////////////////////////////////// //
func FuzzEncode(data []byte) int {
_, err := b.Encode(data)
if err != nil {
return 1
}
return 0
}
func FuzzDecode(data []byte) int {
_, err := b.Decode(data)
if err != nil {
return 1
}
return 0
}
func FuzzEncodeBase62(data []byte) int {
s := EncodeBase62(data)
if s == "" {
return 1
}
return 0
}
func FuzzDecodeBase62(data []byte) int {
_, err := DecodeBase62(string(data))
if err != nil {
return 1
}
return 1
}