Skip to main content

Sortable, human-safe transaction IDs (12-char V2) for high-throughput distributed systems.

Project description

txidgen

txidgen generates 12-character, human-safe, lexicographically sortable transaction IDs suitable for payment systems.

Properties

  • Length: 12 (<PREFIX><PAYLOAD11>)
  • Prefix: 1 letter A–Z (never starts numeric)
  • Alphabet: removes ambiguous chars 0 O I 1 U V
  • Sortable: string sort == creation time sort
  • Distributed: supports multiple nodes without coordination
  • Throughput: tuned for 10k TPS+ with a few nodes

V2 layout (50-bit payload)

  • ts10 (38 bits): 10ms ticks since custom epoch (default 2026-01-01 UTC)
  • node (4 bits): 0..15
  • currency (4 bits): 0..15
  • seq (4 bits): 0..15 per node per 10ms tick

Install

pip install txidgen

Usaage

from txidgen import TxIdV2Generator, parse_txid_v2

gen = TxIdV2Generator(node_id=3)
txid = gen.generate(prefix="P", currency="BDT")
print(txid)

parts = parse_txid_v2(txid)
print(parts)

CLI

txidgen gen --prefix P --currency BDT --node 3
txidgen parse P9JQ2H...   # prints decoded parts

Note

This ID is not a secret token. It is time-ordered and may be partially guessable. Use a separate opaque token if you require secrecy.

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

txidgen-0.1.1.tar.gz (7.4 kB view details)

Uploaded Source

Built Distribution

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

txidgen-0.1.1-py3-none-any.whl (7.9 kB view details)

Uploaded Python 3

File details

Details for the file txidgen-0.1.1.tar.gz.

File metadata

  • Download URL: txidgen-0.1.1.tar.gz
  • Upload date:
  • Size: 7.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.3

File hashes

Hashes for txidgen-0.1.1.tar.gz
Algorithm Hash digest
SHA256 c42999d52d542001ba78de3634d4eb8422eb7f2f9a2f832216a7584940a3007b
MD5 b88cc382f8590e17894d40faf4e3f6e3
BLAKE2b-256 2b760f0e9ffab5cce4791a85928b61e9f3a367f4acb900d037beb7b193b4e495

See more details on using hashes here.

File details

Details for the file txidgen-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: txidgen-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 7.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.3

File hashes

Hashes for txidgen-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1f4542b9b994dde9057bcd4965544c7578b5eeb2725a6b4e15bc2ebd093df54f
MD5 ffd7139d6d774eb46c4ccbcbe75fc115
BLAKE2b-256 4c7e3333b6d42512144ad35975d4040caf4006a66323c60acc41c9bbbfd717a3

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