maxcso
maxcso copied to clipboard
CRC somewhere in the file?
Is a checksum of some kind of the original data stored anywhere inside the .cso file? If not, can it be implemented without breaking existing emulator support? I want to map the files to dat file checksums without having to scan and decompress the whole files. If it means having to recompress them once, that is fine.
The CSO format understood by most tools doesn't really have space for it: https://github.com/unknownbrackets/maxcso/blob/master/README_CSO.md#format-version-1
That said, the format could be changed to allow for the CRC to be stored somewhere, which would be useful. Unfortunately, this would require changes to emulators and other tools: because the header size field is unreliable and not always written, tools generally ignore it.
Alternatively, there are two unused bytes. In theory, the header size field (ignored by most tools) could be abused to contain the CRC, and then the unused bytes (also ignored) could be set to specific values to make it unlikely the CRC is actually a header size. This would be hacky at best.
Maybe it could also be put at the end of the file, but I'm not sure if some tools might behave oddly with this.
To note, maxcso has a --crc flag and internal API, which will calculate the CRC without writing a decompressed file. I realize this is not what you're looking for, but just mentioning it in case you were looking at an alternative of decompress + calculate CRC.
-[Unknown]