Skip to main content

A package to generate and validate HomeX ID's (HXID's)

Project description

Homex HXID Generator Library for Python

This is a Python implementation of HXID (HomeX ID) generation and validation. It is intended to be used by both systems that generate HXIDs and systems that want to validate existing HXIDs.

Requirements

This project requires Python version >=3.6.

Installation

Add hxid>=0.1.0 to your requirements.txt file or simply install locally with:

pip install hxid

Usage

The available public methods include:

  • def generate_hxid(prefix: str, seed:str, config: HxidConfig = None, appendage_configs: List[HxidConfig] = []) -> str
  • def is_hxid(candidate: str) -> bool

Also, there is a public class constructor for generating HXID config objects:

  • HxidConfig(prefix: str, seed: str, target_length: int = 9, collision_incrementor: int = 0)

For optimal use of this package, generate your HxidConfig objects and pass these into generate_hxid to produce your HXIDs.

Testing & Contributing

Run tests locally with

python -m unittest tests/test_hxid.py

The test suite will be checked for any Pull Requests made to this repository. Please adapt the tests to your proposed changes for contributing.

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

hxid-0.1.1.tar.gz (3.1 kB view hashes)

Uploaded Source

Built Distribution

hxid-0.1.1-py3-none-any.whl (4.1 kB view hashes)

Uploaded Python 3

Supported by

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