identify-artisanal-integer
v1.0.40278087
Published
Identify whether an artisanal integer is from Mission Integers, Brooklyn Integers or London Integers.
Downloads
6
Maintainers
Readme
identify-artisanal-integer
Identify whether an artisanal integer is from Mission Integers, Brooklyn Integers or London Integers.
- Create your own personal, beautiful, hand-crafted integer at one of:
- Brooklyn Integers
- London Integers
- Mission Integers (dead, see known issues.)
- What those are and why
- Short version: Those are unique ID generator websites that have coordinated their ranges to avoid collisions with each others' IDs.
- Why not just use IDs made from 122 random bits?
- Yes. If you have a random-enough RNG and lots of spare entropy, that's probably preferable, as the death of Mission Integers demonstrates. Please format those 122 bits as UUID v4 so people can recognize your strategy.
- Could there be infinitely many non-conflicting integer ID services?
API
This module exports one function:
identifyArtisanalInteger(i)
Where i
is your artisanal integer, as a number or as a digits-only string.
- Throws a RangeError if the input is a number too high to reliably calculate its parity (even/odd) due to JavaScript's number type constraints.
- Returns
false
if the input seems to not be a positive integer. - Otherwise, returns a string with the capitalized word "Brooklyn", "London",
or "Mission", indicating the number registry that (for the purposes of that
joke) has authority to assign that number.
- No lookup is done to check whether the number was actually assigned yet.
Usage
see test/usage.mjs.
Known issues
- Needs more/better tests and docs.
- Mission Integers seems dead:
- 2015-12-01: Acquired by MapZen
- 2018-07-12: Last commit (
66ab67f
).- The example integer in the readme screenshot is 1159344516.
- Memento of the current branch list
- 2021-06-15: Last known website memento in the Wayback Machine
- 2024-08-14: Wayback machine cannot archive it because: "Cannot resolve host missionintegers.com."
License
ISC