SI standard should be default
See original GitHub issueI noticed that the project defaults to base-2 calculations using the JEDEC “standard”, which is arguably the worst of both worlds.
Firstly and most importantly, 96% of the world (and science within the US) uses the metric system (SI) regularly, where the prefixes kilo-, mega-, etc. all have universal and precise meanings: thousand, million, etc. As such, most of the world understands what these prefixes mean and would expect them to mean the same thing when it comes to bits and bytes, and rightly so: because that is indeed what they mean. JEDEC, however, calls for the unit names and symbols to be represented as if they are SI-based, but actually defines them differently (e.g., kilobyte
and KB
mean 1024 bytes, etc.). This is deceptive, and has been the basis for much confusion and even lawsuits.
To fix this once and for all, the IEC has come up with different names and symbols for the base-2 units. Most operating systems, wisely, switched everything over to SI units. In fact, about 70% of the devices of the world use SI prefixes for everything but RAM by default; Windows is the only unfortunate holdout. Since most people in the world are familiar with the SI and are not in the esoteric field of memory in computer science, they expect SI units. So it’s a bit ironic to refer to the package as a way “to get a human readable file size” when it only caters to 30% of the humans of the world.
To add to the confusion, regardless of JEDEC or SI, most contexts where bits would be used are related to networking, where the prefixes mean the SI definition (base 10) almost always anyway! This can be considered a bug at the moment where the package calculates bits using base-2 by default as well, which is inappropriate in most use cases.
Please change the default to base 10 and remove JEDEC completely; if people want to use base-2, they have the option to do so with the IEC standard, but it at least wouldn’t lie to them about what they’re seeing. I understand that this would be backwards-incompatible, so bumping to another major version is to be expected, but I think it’s important and worth it.
Issue Analytics
- State:
- Created 2 years ago
- Comments:11 (11 by maintainers)
Top GitHub Comments
Re-opened; on sabbatical atm so I’ll be slow to respond.
Now I understand where you’re coming from; I have the same response when I hear “decimate” used incorrectly due to MCU.
I reopened the ticket; if you want, make a PR to change it to IEC as default, or SI. I don’t have a strong opinion, I’m interested in the least issue drama from such a change. I’d wager IEC is the change that people will accept.