Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the best way to serialize data in a language-independent binary format?

I'm looking into a mechanism for serialize data to be passed over a socket or shared-memory in a language-independent mechanism. I'm reluctant to use XML since this data is going to be very structured, and encoding/decoding speed is vital. Having a good C API that's liberally licensed is important, but ideally there should be support for a ton of other languages. I've looked at google's protocol buffers and ASN.1. Am I on the right track? Is there something better? Should I just implement my own packed structure and not look for some standard?

like image 948
bmdhacks Avatar asked Sep 27 '08 20:09

bmdhacks


1 Answers

Given your requirements, I would go with Google Protocol Buffers. It sounds like it's ideally suited to your application.

like image 145
Greg Hewgill Avatar answered Oct 06 '22 00:10

Greg Hewgill