Skip to main content

Name-that-hash api version

🤔 What is this?

Have you ever come across a hash such as 5f4dcc3b5aa765d61d8327deb882cf99 and wondered what type of hash that is? 🤔

Name-that-hash will name that hash type!

Installing

pip

pip install nth_api

poetry

poetry add nth_api

Example

from nth_api.hashes import hashes_dict, popular_hashes_list
import re


def main(chash: str) -> str | list | None:
    # Initialize an empty list to store matching values
    output = []

    # Iterate over patterns in the dictionary
    for pattern in hashes_dict.keys():
        # Check if the hash matches the pattern
        if re.compile(pattern, re.IGNORECASE).match(chash.strip()):
            # Add the corresponding value to the output list
            output.append(hashes_dict[pattern])

    # If matching values are found
    if output:
        # Initialize an empty list to store popular matching values
        populars = []
        # Iterate over matching values
        for name in output:
            # Check if the value is popular
            if name in popular_hashes_list:
                # Add the popular value to the list
                populars.append(name)

        # Return the first popular value if found, otherwise return all matching values
        return populars[0] if populars else output


if __name__ == '__main__':
    try:
        # Call the main function with a sample hash (MD5)
        print(main("46f94c8de14fb36680850768ff1b7f2a"))

    # Handle KeyboardInterrupt gracefully
    except KeyboardInterrupt:
        exit()

Metadata

Release files for nth-api 1.3.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for nth-api 1.3.5
File Size Uploaded
nth_api-1.3.5.tar.gz 19.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for nth-api 1.3.5
File Interpreter ABI Platform
nth_api-1.3.5-py3-none-any.whl Python 3 none any Details

Total release size: 38.8 kB

Release files / nth_api-1.3.5.tar.gz

Download URL nth_api-1.3.5.tar.gz
Size 19.4 kB
Tags Source
SHA-256 checksum
How to use checksums
9077637d34084b5ae638606e2a865453c5ca38fe212b11e40646bc8e7262e3ae
BLAKE2b-256 checksum
How to use checksums
132518c4b65d99afbe29c7c3a1956cc2f5bbdd911728e8fd734b22bae9b95de9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.9.19

Release files / nth_api-1.3.5-py3-none-any.whl

Download URL nth_api-1.3.5-py3-none-any.whl
Size 19.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
23ddbfc40be278c4bdd9f1b87686ce91308be1e3f91a021467686e6c53cfba52
BLAKE2b-256 checksum
How to use checksums
aa930b05baafb016173511d019576dac8b862cce3535ab20d5647d5ad70df6cc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.9.19

Release history Release notifications | RSS feed

This release

1.3.5 This release

2 release files

1.3.4

1 release file

1.3.3

1 release file

1.3

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page