Metadata-Version: 2.4
Name: txidgen
Version: 0.1.1
Summary: Sortable, human-safe transaction IDs (12-char V2) for high-throughput distributed systems.
Project-URL: Homepage, https://github.com/nexoora/txidgen
Project-URL: Repository, https://github.com/nexoora/txidgen
Project-URL: Issues, https://github.com/nexoora/txidgen/issues
Author-email: Your Name <you@example.com>
License: MIT License
        
        Copyright (c) 2026 lazer-duck
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENSE
Keywords: distributed,id,payments,snowflake,sortable,transaction,ulid
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Typing :: Typed
Requires-Python: >=3.9
Description-Content-Type: text/markdown

# 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
```bash
pip install txidgen
```

### Usaage
```python
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
```bash
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.