encode_m 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +8 -0
- data/lib/encode_m/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 96ea1d9d116d1769dc5bf349324e2e8c1c9922502d05b3b461b8226dad000a90
|
4
|
+
data.tar.gz: ca7a179267d437c13d91f8cc2f7c5f0f37f9041d77c0768f3c24e41a38735d6b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e10fe7af033cc0efb3d69a31b7cb5591d75f71ac9f9f8a97d5456f44f7a1bb0397069f7d00c22cac747ff2fd62428d68e5650e0039316e2d3563e45593d8fc37
|
7
|
+
data.tar.gz: 6dec98fba0bd26a39093475d6647a59fa0391e2451fd5dbc2b07511e131d425c07fb7f925608b8e3eab93aad329b23a42414e943d4677db0d0623645426b0428
|
data/README.md
CHANGED
@@ -5,6 +5,14 @@
|
|
5
5
|
|
6
6
|
Bringing the power of M language (MUMPS) numeric encoding to Ruby. Based on YottaDB/GT.M's 40-year production-tested algorithm.
|
7
7
|
|
8
|
+
## Why You Should Use EncodeM
|
9
|
+
|
10
|
+
If you're building anything that stores numbers in a database or key-value store, EncodeM is a game-changer. The magic is simple but powerful: when you encode numbers with EncodeM, the resulting byte strings maintain numeric sort order. This means your database can compare and sort numbers **without ever decoding them** - just pure byte comparison like strcmp(). Imagine your B-tree indexes comparing numbers 3x faster because they never deserialize, or range queries that just compare raw bytes. This is the secret sauce that's been powering Epic (used by 70% of US hospitals) and other M language systems for 40 years.
|
11
|
+
|
12
|
+
Beyond the sorting superpower, EncodeM is surprisingly memory efficient. Small numbers (1-99) take just 2 bytes compared to 8 for a Float, and common values stay compact at 2-6 bytes. You get 18 digits of precision - more than Float but without BigDecimal's overhead. The encoding handles positive, negative, and zero correctly, maintaining perfect sort order across the entire numeric range.
|
13
|
+
|
14
|
+
The best part? It's production-tested technology. This isn't some experimental algorithm - it's literally the same encoding that's been processing medical records and financial transactions since the 1980s in YottaDB/GT.M systems. If you're building a system where you need sortable numeric keys (think time-series data, financial ledgers, or any ordered numeric index), EncodeM gives you the performance of byte-level operations with the correctness of proper numeric comparison. Drop it in, encode your numbers, and watch your database operations get faster.
|
15
|
+
|
8
16
|
## About the M Language Heritage
|
9
17
|
|
10
18
|
The M language (formerly MUMPS - Massachusetts General Hospital Utility Multi-Programming System) has been powering critical healthcare and financial systems since 1966. Epic (70% of US hospitals), the VA's VistA, and numerous banking systems run on M. This gem extracts one of M's most clever innovations: a numeric encoding that maintains sort order in byte form.
|
data/lib/encode_m/version.rb
CHANGED