Hello,
I am using the following code to create a protocol version number.
fn derive_version() u32 {
@setEvalBranchQuota(50000);
const crc = std.hash.Crc32.hash;
return crc(@embedFile("./msg.zig")) ^ crc(@embedFile("./client.zig"));
}
pub const VERSION = derive_version();
It works, but it is very slow to compile, and requires a huge "eval branch quota".
Do you have an idea for something faster?
The value does not really matter, the is just to detect version mismatch during development, in production the value will be hardcoded.