Skip to content
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.

Create VarInt writer #5219

Closed
pablitovicente opened this issue Apr 29, 2020 · 0 comments · Fixed by #5319
Closed

Create VarInt writer #5219

pablitovicente opened this issue Apr 29, 2020 · 0 comments · Fixed by #5319
Assignees
Milestone

Comments

@pablitovicente
Copy link
Contributor

pablitovicente commented Apr 29, 2020

Description

Create function varint(value: number, schema) => buffer

Motivation

lisk-codec will include a set of Writers for each data type defined in the LIP, to that end
we need a function to write VarInts.

Acceptance Criteria

  • varint() should accept numbers (including bigInts)
  • varint() returns a buffer that can be passed through the varInt reader to get the original value
  • Code should be optimised for speed as much as possible
  • Full test coverage
  • Performance stats are provided based on the writing of values of different sizes and measure the writing of 100, 500, 1000, 30000 varints

Additional Information

Check if it will make sense to implement signed varints in same issue.

Related issues: #5200

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants