Skip to content

A small library in Rust that takes a protobuf serialized message and sorts fields inside, so that the field order becomes deterministic.

License

Notifications You must be signed in to change notification settings

a-kordys/protofixer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

protofixer

A small library in Rust that takes a protobuf serialized message and sorts fields inside, so that the field order becomes deterministic.

Example:

use prost::Message;
use protofixer::sort_protobuf_message;

fn encode_canonically(object: &MyData) -> Vec<u8> {
    let msg = Message::encode_to_vec(object);
    let canonical = sort_protobuf_message(&msg).expect("bad output of Message::encode_to_vec()");
    canonical.to_owned()
}

About

A small library in Rust that takes a protobuf serialized message and sorts fields inside, so that the field order becomes deterministic.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Languages