Skip to content

Provide library functions to convert numbers into BE-ordered byte strings #3606

@roman-khimov

Description

@roman-khimov

Is your feature request related to a problem? Please describe.

I'm always frustrated when contracts have to write code to deal with simple problems. BE-serialized integers are useful because of their ordering characteristics, but default int->bytes conversion is LE in the VM.

Describe the solution you'd like

Provide methods to obtain fixed-width byte string from integer in BE format.

Additional context

nspcc-dev/neofs-contract#438

Metadata

Metadata

Assignees

No one assigned

    Labels

    I3Minimal impactS4RoutineU4Nothing urgentfeatureCompletely new functionalitygood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions