FWID (FourWord Identifier)
A novel random identifier generation method with time-series sortability.
Overview
FWID is a random identifier designed for use cases such as database primary keys.
The length is variable: any multiple of 32 bits. As of 2026-11-04, the recommended length is 192 bits.
[ timestamp: total bits / 4 ] + [ CSPRNG output: total bits / 4 × 3 ]
The timestamp is the number of milliseconds since 2001-01-01 00:00:00 UTC. Because it occupies a quarter of the total length instead of a fixed width, a longer identifier also lasts longer before its timestamp overflows. The trade-off is more leading zeros in the timestamp.
Formats
| Format | Encoding | Example (192 bits) |
|---|---|---|
| Standard Text | Base32 Hex, Z as padding |
00NNTHJS00TETRA0QEQOA000000000001LISHPGZ |
| Readable Text | Crockford's Base32, lowercase, no padding, hyphen every 8 characters | 00qqxhkw-00xexva0-tetra000-00000000-1njwhsg |
| Compact Text | Base62, fixed length | 007h3WQ0lRIoEEs6MANGd9PJQhKTtetra |
See SPEC.md for the full specification: bit lengths, layout, overflow rules, text formats and their parsing rules, collision probability and overflow times.
Etymology
The name "Four" comes from the fact that the timestamp occupies 1/4 of the bit length. It is also a wordplay on the word "Forward".
Implementations
Implementations for Python (this package, in src/fwid), Rust, Go, Swift, JavaScript and Lython Compiler are included, each with the same command line tool. See docs/implementations.md.
License
The source code and libraries in this repository are freely available under the MIT License.
No attribution is required for software that utilizes the FWID specification itself or for data generated using FWID.
Metadata
Release files for fwid 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| fwid-0.1.0.tar.gz | 6.5 kB | With provenance | Details for fwid-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| fwid-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for fwid-0.1.0-py3-none-any.whl |
Total release size: 15.6 kB
Release files / fwid-0.1.0.tar.gz
| Download URL | fwid-0.1.0.tar.gz |
|---|---|
| Size | 6.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4fdfee92bd9ff9533690d05cd4c51ab00e214fb77a6b92ca51c83c5552825526
|
|
BLAKE2b-256 checksum How to use checksums |
d95d0976e3bc576d189a92053fc22fdd744d9fb94e900f73ef32c5a6c426a4cb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 17, 2026.
Transparency logRelease files / fwid-0.1.0-py3-none-any.whl
| Download URL | fwid-0.1.0-py3-none-any.whl |
|---|---|
| Size | 9.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ee1b85bdaecee61cfa50b9bee747ba5102dbac93b6a9f24ada5b351bb5bd9848
|
|
BLAKE2b-256 checksum How to use checksums |
8920e6b1623fa074eabc90d758674e52b18b01883bdff082298f790b1eeb0e38
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 17, 2026.
Transparency logSecurity for fwid 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for fwid-0.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 17, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.