Skip to main content

Memorable Unique Identifier

Project description

muid

Memorable Unique Identifiers

Wait you say ... that's an oxymoron

Memorable unique identifiers are a provocative misnomer. When generating unique identifiers such as privately used keys, memorability is antithetical to uniqueness. MUIDs might be better termed "hash-memorable" identifiers. They form a subset of UUIDs whose SHA-256 hashes are memorable. See the https://vimeo.com/397352413 for further explanation.

Start mining now

Just want to mine?

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/microprediction/muid/master/examples/mine_from_venv.sh)"

If it fails you might need Python 3

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew install python

Using the library directly

As per https://muid.readthedocs.io/en/latest/ ...

Install

pip install muid

Hash-memorability

>>> muid.mhash(b'f601f291896bb66b8a3c3d783077713a')
b'56a33411a3ae7cfc95597911708358ad'

Don't see it?

>>> muid.pretty(b'56a33411a3ae7cfc95597911708358ad',k1=6,k2=5)
'Shammy Llama'

Validation

>>> muid.animal(b'f601f291896bb66b8a3c3d783077713a')
'Shammy Llama'

>>> muid.validate(b'f601f291896bb66b8a3c3d783077713a')
True

Mining

>>> muid.mine()

{'hash': b'56a33411a3ae7cfc95597911708358ad',
'key': b'f601f291896bb66b8a3c3d783077713a',
'length': 11,
'pretty': 'Shammy Llama'}

{'hash': b'6ea176470adcff53855f04181bca1a1b',
'key': b'fb74baf628d43892020d803614f91f29',
'length': 11,
'pretty': 'Healthy Toad'}

{'hash': b'a3e76457c0de70a153e82067845f1527',
'key': b'769adf0f307181e4ab2bc4c1b991cdc6',
'length': 11,
'pretty': 'Amethyst Cod'}

Bequeath unwanted MUIDs to a worthy statistician.

Applications

See the video at https://vimeo.com/397352413 for some motivation.

We hope you have an application that can benefit from one less join.

Implementation decisions

We welcome thoughtful suggestions at https://github.com/microprediction/muid/issues

Choice of hash

We truncate the output of hashlib.sha256

Readable hex

Hex Human Hex HUman Hex Human
1 l 5 s 9 g
2 z 6 h 0 o
3 m 7 t
4 y 8 x

Miscellaneous

Collisions

MUID collision requires approximately the same computational capacity as UUID collision or more.

Stupid dog trick

https://vimeo.com/396819347

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

muid-0.2.12.tar.gz (13.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

muid-0.2.12-py3-none-any.whl (18.4 kB view details)

Uploaded Python 3

File details

Details for the file muid-0.2.12.tar.gz.

File metadata

  • Download URL: muid-0.2.12.tar.gz
  • Upload date:
  • Size: 13.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.6

File hashes

Hashes for muid-0.2.12.tar.gz
Algorithm Hash digest
SHA256 65c24718ad8ad76eff9a914f8c149bb1a67c718525cd6e390fe0fb8742c3bbd9
MD5 646479bf5d52ac9c32b1658d0b5793f8
BLAKE2b-256 650da63836be9fd5b84f725bcf88e285e5bda6b5d30a3883e3056cbbc411bef5

See more details on using hashes here.

File details

Details for the file muid-0.2.12-py3-none-any.whl.

File metadata

  • Download URL: muid-0.2.12-py3-none-any.whl
  • Upload date:
  • Size: 18.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.6

File hashes

Hashes for muid-0.2.12-py3-none-any.whl
Algorithm Hash digest
SHA256 1b7dc38e8f631903556b2e018f012836fcd48da89e91c2a61e875f64dd03cd76
MD5 513bec6970365318e20bde944d49cf8d
BLAKE2b-256 e4709669517f2bd94f391f84dd4c4f4e60d8b2730b9b892e5f6d0e7686aa9a47

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page