bencode inspired tight self describing serialization format
1
2
3
4
5
6
7
8
9
10
11
12
13
#![no_main]

use bendncode::from_bytes;
use libfuzzer_sys::fuzz_target;
use serde_json::{from_slice, Value};

fuzz_target!(|data: &[u8]| {
    if let Ok(x_) = from_bytes::<Value>(data) {
        let x = bendncode::to_bytes(&x_).unwrap();
        let y = from_bytes::<Value>(&x).unwrap();
        assert_eq!(x_, y, "{data:?}: {x:?}: {x_}: {y}");
    }
});