Skip to content

Conversation

@JanBobolz
Copy link
Member

Added new BinaryFormatConverter that serializes Representations to byte[] and back.
This format is much more compact format than JSONConverter's.

The efficiency gains are mostly because:

  • No Base64 encoding of ByteArrayRepresentation (and BigIntegerRepresentation) is needed - each such value just ends up "as is" (in two's complement) in the binary format.
  • If some String (or class name) is referenced multiple times, it is only encoded once, all occurrences are replaced with a 4-byte reference to the String.
  • The caller can optionally pass a list of "well-known" strings and class names, in which case these Strings don't end up in the serialization format at all (again replaced by a short reference). So Strings like "de.upb.crypto.math.structures.zn.Zn" don't have to appear in the serialization format at all if the caller provides those ahead of time.

@rheitjoh rheitjoh merged commit 828e026 into master Mar 7, 2020
@rheitjoh rheitjoh deleted the shorterRepr branch March 7, 2020 12:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants