Skip to main content

A Python package for generating unique and secure IDs using Prime Extended Decimal Index Listing (PEDIL).

Project description

PEDIL

PEDIL (Prime Extended Decimal Index Listing) is a Python package designed for generating unique IDs using prime numbers. It leverages an innovative indexing method that uses prime numbers to uniquely identify software components.

Features

  • Unique ID Generation: Generate unique IDs using prime numbers.
  • Scalable: Supports multiple levels of depth for ID generation, offering a vast number of unique identifiers.
  • Efficient: Optimized for performance with manageable chunk sizes for prime generation.

Installation

You can install the package using pip:

pip install pedil

Usage

Here is a simple example demonstrating how to use PEDIL to generate unique IDs.

from pedil import PEDIL

# Create an instance of the PEDIL class
pedil = PEDIL()

# Generate unique IDs securely
id1 = pedil.get_or_create_prime_id("1")
id2 = pedil.get_or_create_prime_id("1,1")
id3 = pedil.get_or_create_prime_id("2,3")
id4 = pedil.get_or_create_prime_id("3,4")

# Return the secure IDs
print(f"{id1}")
print(f"{id2}")
print(f"{id3}")
print(f"{id4}")

example

Prime Extended Decimal Index Listing (PEDIL) Annotation System

The PEDIL notation uses commas to separate different levels. Each level represents a multiplier for the corresponding power of the base array size. The notation allows for scalable and flexible ID generation.

For example, consider the notation (1,3,5) with a base array size of N primes:

1 * N^2
3 * N^1
5 * N^0

The final prime index is the sum of these values. Example Notations

Single Level: "1" -> Represents the 1st prime.
Two Levels: "1,1" -> Represents the sum of 1 * N^1 + 1 * N^0.
Three Levels: "2,3,5" -> Represents the sum of 2 * N^2 + 3 * N^1 + 5 * N^0.

Maximum Unique IDs Using the First 78,498 Primes (Primes up to 1 Million)

1 Level of Depth: 78,498 unique IDs
2 Levels of Depth: 78,498^2 = 6,161,251,004 unique IDs
3 Levels of Depth: 78,498^3 = 4,847,646,381,177,992 unique IDs

Performance Considerations

1 Level of Depth: Suitable for most applications, providing a large number of unique IDs efficiently.
2 Levels of Depth: Suitable for applications requiring even more unique IDs, with manageable computational overhead.
3 Levels of Depth: Provides an enormous number of unique IDs but may involve significant computational time and resources.

Applications and Use Cases Practical Use

For most real-world applications, using 1 or 2 levels of PEDIL notation should be sufficient to provide a vast number of unique IDs efficiently without excessive computational overhead. Big Data and Machine Learning

For applications like big data and machine learning, where handling trillions of tokens and long processing times are common, PEDIL can scale to higher levels and larger base arrays, offering unique IDs in far beyond the trillions.

Security Considerations

Salting and Hashing

Each ID is salted and hashed using HMAC with SHA-256 to ensure uniqueness and prevent prediction or spoofing.
The salt is randomly generated during initialization, making each ID unique even with the same input.

License

This project is licensed under the MIT License.

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

pedil-0.1.1.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

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

pedil-0.1.1-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pedil-0.1.1.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.6

File hashes

Hashes for pedil-0.1.1.tar.gz
Algorithm Hash digest
SHA256 9aea5e9cf5aabc22e97efc086970f32e7ab8d8338827ad70533867d5c3a28693
MD5 0429f678eaa1ad39d92c1611340e3825
BLAKE2b-256 8ad3a452e3ce0fc483c36e9e826432544d409d18a3dcf1816b209045223e489e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pedil-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 4.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.6

File hashes

Hashes for pedil-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 af95be6922bc6cd4f923492f3602daf3dd947ff9ec70115f17b75c3a0ce05c9b
MD5 e5b150dd8998b32f2bab3451760b44e8
BLAKE2b-256 ee2c4b2a392443ea4e04fa7821706df53be839717ad9068bda5c8187c30f6354

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