Skip to content

Latest commit

 

History

History
90 lines (59 loc) · 6.74 KB

File metadata and controls

90 lines (59 loc) · 6.74 KB
graph LR
    Hashids_Public_API_Facade_["Hashids Public API (Facade)"]
    Encoding_Core_Logic["Encoding Core Logic"]
    Decoding_Core_Logic["Decoding Core Logic"]
    Alphabet_Character_Management["Alphabet & Character Management"]
    Input_Validation_Utilities["Input Validation & Utilities"]
    Hashids_Public_API_Facade_ -- "delegates encoding to" --> Encoding_Core_Logic
    Hashids_Public_API_Facade_ -- "delegates decoding to" --> Decoding_Core_Logic
    Hashids_Public_API_Facade_ -- "initializes/configures" --> Alphabet_Character_Management
    Hashids_Public_API_Facade_ -- "utilizes" --> Input_Validation_Utilities
    Encoding_Core_Logic -- "utilizes" --> Alphabet_Character_Management
    Encoding_Core_Logic -- "utilizes" --> Input_Validation_Utilities
    Encoding_Core_Logic -- "returns encoded hash to" --> Hashids_Public_API_Facade_
    Decoding_Core_Logic -- "utilizes" --> Alphabet_Character_Management
    Decoding_Core_Logic -- "utilizes" --> Input_Validation_Utilities
    Decoding_Core_Logic -- "returns decoded integers to" --> Hashids_Public_API_Facade_
    Alphabet_Character_Management -- "provides characters to" --> Encoding_Core_Logic
    Alphabet_Character_Management -- "provides characters to" --> Decoding_Core_Logic
    Input_Validation_Utilities -- "provides validation to" --> Hashids_Public_API_Facade_
    Input_Validation_Utilities -- "provides validation to" --> Encoding_Core_Logic
    Input_Validation_Utilities -- "provides validation to" --> Decoding_Core_Logic
Loading

CodeBoardingDemoContact

Details

The hashids-python library is designed as a cohesive utility for generating and decoding short, unique, and non-sequential IDs. Its architecture is centered around the Hashids Public API (Facade), which acts as the primary interface, abstracting the complexity of the underlying hashing algorithms. Data flow initiates when a user calls an encoding or decoding method on the Hashids object. These calls are then delegated to the specialized Encoding Core Logic or Decoding Core Logic components, respectively. Both core logic components interact with the Alphabet & Character Management module to handle the specific character sets and their permutations, and they rely on the Input Validation & Utilities for ensuring data integrity throughout the process. This clear separation of concerns facilitates maintainability and provides a straightforward flow for visual representation, highlighting the transformation of input data through distinct processing stages.

Hashids Public API (Facade)

The primary entry point for users, providing a simplified interface for encoding and decoding operations. It initializes the hashing parameters and orchestrates calls to internal logic.

Related Classes/Methods:

Encoding Core Logic

Encapsulates the fundamental algorithm for transforming a sequence of integers into a unique hash string, including character manipulation and length enforcement.

Related Classes/Methods:

Decoding Core Logic

Contains the algorithms for reversing the hashing process, converting a hash string back into its original sequence of integers, including string splitting and reverse hashing.

Related Classes/Methods:

Alphabet & Character Management

Manages the internal character set (alphabet), separators, and guards used in the encoding and decoding processes, handling reordering and selection based on salt and internal state.

Related Classes/Methods:

Input Validation & Utilities

Provides helper functions for validating input types (e.g., unsigned integers, strings) and other minor utility operations, including handling deprecated methods.

Related Classes/Methods: