TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Ask HN: Why LEB128 and VLQ use Base 128 instead of 64?

1 pointsby conaclosabout 3 years ago
I am currently participating to the specification of a binary format that includes variable-length integers.<p>I am wondering why VLQ&#x2F;LEB128 [1] use base 128 instead of a more usual Base 64? Is this related to specific needs of where these formats come from?<p>A Base 64 could not be simpler to implement?<p>[1] https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;LEB128

1 comment

PaulHouleabout 3 years ago
What is usual about base 64? Many variable length schemes use the first bit to code if this is the last byte, then use the remaining 7 bits to code numbers.<p>The counter example is schemes like UTF-8 where the prefix of the bitstream is 0, 10, 110, etc. and how many 1s there are tells how many extra bytes are used.
评论 #31063764 未加载