How to store a set of four 5-bit values in one 16-bit value
Cool trick to store 4 5-bit values in one 16-bit value. - jaamesd/BucketCompressionTrick
How to store a set of four 5-bit values in one 16-bit value launched on January 28, 2018 with 188 votes, #160 of 3,021 launches that month and more than 95% of that year's launches. The site was still online in September 2026, 8 years on.
In plain words
This is a GitHub repository explaining how to pack four 5-bit values into a single 16-bit integer. It provides technical guidance on bitwise operations and data compression for developers who need to store multiple small numeric values efficiently within a fixed memory space. The resource targets programmers working with constrained systems or optimizing data structures.
written from the facts on this page · September 2026
Does a similar job
all alternatives →
A nibble-oriented CPU in Verilog to build a scientific calculatorMay 2026 · github.com · ▲119The core question: how did HP's scientific calculators actually work at the gate level? That rabbit hole led to building one from scratch. The architectural decision everything else follows from: a decimal calculator should store numbers as BCD — one decimal digit per 4-bit nibble. A standard byte-oriented CPU (Z80, 6502) fights that layout constantly. So I designed a small custom CPU in Verilog where 4 bits is the natural data width and memory is nibble addressable. What the project covers: - Custom CPU: Harvard architecture, 12-bit ISA, 8-state execution FSM, hardware stack guard with a…
Outperforming VByte for Large Integers Using Phi-Encoding2024 · github.com · ▲15Properties of a Novel Binary Representation of Integers using Base-𝜙 - irradix/paper.md at main · DOSAYGO-STUDIO/irradix
A hash array-mapped trie implementation in C2023 · github.com · ▲171Long-simmering side project that is finally ready to see the light. HAMTs are a cool persistent data structure and implementing one has been a lot of fun. Beyond the code, there is likely some value in the extensive and largely complete implementation docs; basic benchmarks are linked in the README, too. Kind of aiming to be "the libavl for HAMTs". That is obviously a high and aspirational bar but a distinct possibility if it stirs up a little interest and/or contribution. Anyways, it's time for this to go out, collect feedback and maybe even some use outside of toy projects. Let me…
Simple in-memory key/value store written in Elixir using Shards2016 · github.com · ▲80Simple in-memory Key/Value Store written in Elixir using `cabol/ex_shards` - cabol/kvx
Rain hashes – well designed, simple and fast variable sized hashes2024 · github.com · ▲79The fastest 128-bit and 256-bit hash, passes all tests, and under 140 source lines of code. API library and CLI tool in C++ and NodeJS/Wasm - DOSAYGO-STUDIO/rain
- OAOverfitted a 900KB Transformer to Compress a 100MB CSV into 7MBJun 2026 · ▲112
I built an experiment that uses an overfitted transformer and arithmetic coding to compress individual files. Instead of training the model to generalize, I train a 900KB transformer to memorize a single file and predict the next byte. Those predictions are fed into an arithmetic coder to produce the compressed output. On a 100MB NYC taxi CSV, it compresses to about 7MB (~0.5 bits/byte). On a 100MB slice of enwik9, it compresses to about 21MB (~1.68 bits/byte). It's pretty slow right now (roughly 20–30 minutes of training and 45 minutes each for compression and decompression on my…
Source: Show HN post ↗
Launched alongside, January 2018
the whole month →
Buy Me a Coffee▲1,411A simple, meaningful way to fund your creativity.
Growth · 2018 · buymeacoffee.com


Indie Hackers Community▲1,095Work together to build profitable businesses & side projects
Work · 2018 · indiehackers.com
Typeform 2.0▲793Build beautiful conversational forms, surveys and more
Life & fun · 2018 · typeform.com
