Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Global.serialize function to serialize instance of any type #988

Open
kushti opened this issue May 16, 2024 · 1 comment · Fixed by #989
Open

Global.serialize function to serialize instance of any type #988

kushti opened this issue May 16, 2024 · 1 comment · Fixed by #989
Assignees
Milestone

Comments

@kushti
Copy link
Member

kushti commented May 16, 2024

Implement Global.serialize function with SAny -> SByteArray signature to serialize an instance of any type.

It is replacing following existing PRs:

#982 (just started)
#984 (just started)
#974

Header serialization can be found in #974

Do round-trip tests against Global.deserialize[T] from #979

@kushti kushti added this to the v6.0 milestone May 16, 2024
@aslesarenko
Copy link
Member

It is replacing following existing PRs:

#982 (just started) #984 (just started)

@kushti, it may still be useful to have a separate Numeric.toBytes method because generic serialize produces ZigZag encoded bytes for numeric types.

We can call it Numeric.toBigEndianBytes.

This will be consistent with the existing longToByteArray, byteArrayToLong, byteArrayToBigInt, but will work for all numeric types.

@aslesarenko aslesarenko linked a pull request May 21, 2024 that will close this issue
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 a pull request may close this issue.

2 participants