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

Create VarInt reader #5221

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

Create VarInt reader #5221

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(buffer, schema) => value

Motivation

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

Acceptance Criteria

  • varint() should accept a buffer representation of a varint value
  • varint() returns either a number or a BigInt (this is controlled by the schema)
  • Code should be optimised for speed as much as possible
  • Full test coverage
  • Performance stats are provided based on the reading of values of different sizes and measure the reading 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