VarInt And VarLong: Revision history

Jump to navigation Jump to search

Diff selection: Mark the radio buttons of the revisions to compare and hit enter or the button at the bottom.
Legend: (cur) = difference with latest revision, (prev) = difference with preceding revision, m = minor edit.

12 March 2024

19 May 2022

  • curprev 14:5314:53, 19 May 2022imported>Rmheuerm 4,910 bytes +7 Cast shift to long in readVarLong to prevent data loss from implicit integer shift

24 April 2022

21 March 2022

  • curprev 23:0523:05, 21 March 2022imported>Pv6q 4,893 bytes +109 Made the pseudocode more readable by giving names to the bit masks. Also made the readVarInt and readVarLong methods more efficient.

20 January 2022

24 November 2021

  • curprev 09:4309:43, 24 November 2021imported>Doot 4,772 bytes +8 fix some variable names (if anyone wants to discuss mojang's version, feel free to ping me from the sponge, paper, forge, or fabric discords at doot#0001)
  • curprev 09:2209:22, 24 November 2021imported>Doot 4,764 bytes +101 Use mojang's own version of readVarInt/readVarLong
  • curprev 09:1609:16, 24 November 2021imported>Doot 4,663 bytes −196 Replace writeVarInt/writeeVarLong with mojang's own version (binary is not easier to read precisely because it takes more digits to represent, and is therefore prone to human error)

3 November 2021

3 October 2021

1 September 2021

  • curprev 22:1622:16, 1 September 2021imported>Pv6q 4,633 bytes −56 The LEB128 wiki, which was linked on this page, uses bit-based segmenting: https://en.wikipedia.org/wiki/LEB128#Decode_signed_integer

21 August 2021

  • curprev 22:1622:16, 21 August 2021imported>Doot 4,689 bytes −18 Based on this blog post by Velocity's creator: https://steinborn-me.pages.dev/posts/performance/how-fast-can-you-write-a-varint/Replace VarInt/VarLong writing methods with Velocity's old varint writing method (with an extended version for varlong writing). Should make it easier to understand by replacing the do-while with just a while loop.
  • curprev 21:4621:46, 21 August 2021imported>Doot 4,707 bytes +70 proper varint serialization uses byte-based segmenting rather than bit-based :)

3 August 2021

2 August 2021

29 June 2021

26 June 2021

  • curprev 21:1521:15, 26 June 2021imported>Pv6q 4,669 bytes −38 Added the comments to my previous code
  • curprev 20:2520:25, 26 June 2021imported>Doot 4,707 bytes +264 Undo revision 16775 by Pv6q (talk) - Reverted because it unnecessarily removed a helpful comment and needlessly changed variable names. The old methods have worked fine for literally years, there's no point in changing something that isn't broken.
  • curprev 14:2914:29, 26 June 2021imported>Pv6qm 4,443 bytes −264 Made my previous code more readable and added the error cases
  • curprev 00:3900:39, 26 June 2021imported>Doot 4,707 bytes +391 Undo revision 16749 by Pv6q (talk) - pseudocode favors readability over efficiency, and your new readVarInt/readVarLong incorrectly handles the error case.

24 June 2021

6 June 2021

25 October 2020

4 August 2020

28 June 2020

  • curprev 04:2904:29, 28 June 2020imported>NodeDigitalm 4,474 bytes +1 Change int to long in readVarLong(). Necessary to parse VarLongs with more than 4 bytes in Java

8 June 2020

  • curprev 16:3516:35, 8 June 2020imported>TkTech 4,473 bytes +4,473 Created page with "Variable-length format such that smaller numbers use fewer bytes. These are very similar to [http://developers.google.com/protocol-buffers/docs/encoding#varints Protocol Buff..."