Schema Library
Ready-made EByte schemas for real formats. Each one comes with a real sample file, and on every change to EByte the tests decode that sample and encode it back, checking every byte. Download a schema, point ebyte at your own file, and you’ll know within a line whether it matches.
| Format | Schema | Sample | Walkthrough |
|---|---|---|---|
| Plain PCM WAV | pcm-wav.schema.json | tone.wav | WAV case study |
| 24-bit BMP | bmp-24bit.schema.json | stripes.bmp | BMP case study |
| WAV, any chunks | riff-wave.schema.json | tagged.wav | WAV chunks case study |
| ZIP, any entries | zip.schema.json | three.zip | ZIP case study |
| One-file ZIP | zip-one-stored-file.schema.json | one.zip | ZIP case study |
All five are in the schemas folder on GitHub, along with a note on each schema’s limits.
Using One
ebyte validate-schema --schema pcm-wav.schema.json
ebyte inspect --schema pcm-wav.schema.json --input recording.wav --format text
A file that matches gives a complete trace and exit code 0. A file that doesn’t gives one line of JSON naming the field and the byte offset where it stopped matching, and exit code 2. The folder-check example runs the WAV schema over a whole folder.
What Each Schema Covers
WAV. The 44-byte header of a plain PCM file, with the RIFF, fmt and data chunks in that order. Files with extra chunks, such as a LIST chunk of metadata, are reported as trailing data. When you change the sample rate or the amount of audio, update byte_rate, riff_size and data_size yourself.
WAV, any chunks. Needs EByte 0.2.0. Reads the RIFF header and then every chunk, fmt , data, LIST or anything else, in whatever order they come, each as an id, a size and a raw body. Chunks can be added, removed or reordered in the document; riff_size is still edited by hand. Chunks with an odd size, padded with a byte the size doesn’t count, aren’t supported and stop the schema at the pad byte.
BMP. Uncompressed 24-bit images with the 40-byte info header, stored bottom-up or top-down. Paletted, 32-bit and compressed BMPs are rejected at the field that differs. Sizes are edited by hand.
ZIP, any entries. Needs EByte 0.2.0. Reads local entries while they start with PK 03 04, then central directory entries while they start with PK 01 02, then the end record, so any number of stored or compressed files works. Archives using data descriptors, ZIP64 or split volumes aren’t supported. Sizes, counts, offsets and CRC-32 are edited by hand and not checked.
One-file ZIP. An archive holding exactly one stored (uncompressed) file, from the local header to the end record. A second file stops the schema inside the second file’s header. CRC-32 isn’t checked, so a damaged file can still match.
What’s Coming
Repeating blocks arrived in 0.2.0. Next are sizes and offsets that update themselves, then checksums that are checked and written. As each one lands, the schemas here get wider and new formats join the list. To suggest a format, use the contact page.