netserializer icon indicating copy to clipboard operation
netserializer copied to clipboard

Getting a hash of the included types

Open cswiedler opened this issue 8 years ago • 1 comments

This may already exist, but I'm not sure where to request/ask about it. Is there a way to get a hash of all of the types that Netserializer knows about? The idea would be to use this as a 'protocol version', meaning that if it changes, the client and server are incompatible with each other. Since Netserializer is already going recursively though all of the types that we would possibly send over the wire, it seems like we could build a unique value that the two sides can use to verify they speak the exact same protocol.

Right now we require the client and server to be from exactly the same build, but it would be very useful to be able to verify that they're compatible without that requirement (while still ensuring that none of the messages / types involved in the protocol have been changed).

cswiedler avatar May 09 '16 21:05 cswiedler

There's GetSHA256(). But it only looks for type names and type IDs, so it won't notice things like added fields.

tomba avatar May 10 '16 05:05 tomba