uwiger / sext

Sortable Erlang Term Serialization
Apache License 2.0
106 stars 52 forks source link

prefix encode for binaries #26

Open brigadier opened 8 years ago

brigadier commented 8 years ago

is it possible to do prefix encode so that prefix(<<"ab">>) would be the exact prefix of prefix(<<"abc">>)? I see it could be done for lists.

And also prefix([term, <<"ab">>]) as a prefix for prefix([term, <<"abc">>])

uwiger commented 8 years ago

It's a problem. I did a form of prefix encoding of binaries for the kvdb database:

https://github.com/Feuerlabs/kvdb/blob/master/src/kvdb_lib.erl#L261

...but I haven't tried to integrate it into sext.