Skip to main content

Name-That-Hash api version

Project description

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()

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

nth_api-1.3.5.tar.gz (19.4 kB view details)

Uploaded Source

Built Distribution

nth_api-1.3.5-py3-none-any.whl (19.3 kB view details)

Uploaded Python 3

File details

Details for the file nth_api-1.3.5.tar.gz.

File metadata

  • Download URL: nth_api-1.3.5.tar.gz
  • Upload date:
  • Size: 19.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.9.19

File hashes

Hashes for nth_api-1.3.5.tar.gz
Algorithm Hash digest
SHA256 9077637d34084b5ae638606e2a865453c5ca38fe212b11e40646bc8e7262e3ae
MD5 99c23e866ca69dd4740469a4e60091ae
BLAKE2b-256 132518c4b65d99afbe29c7c3a1956cc2f5bbdd911728e8fd734b22bae9b95de9

See more details on using hashes here.

File details

Details for the file nth_api-1.3.5-py3-none-any.whl.

File metadata

  • Download URL: nth_api-1.3.5-py3-none-any.whl
  • Upload date:
  • Size: 19.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.9.19

File hashes

Hashes for nth_api-1.3.5-py3-none-any.whl
Algorithm Hash digest
SHA256 23ddbfc40be278c4bdd9f1b87686ce91308be1e3f91a021467686e6c53cfba52
MD5 53a86be21cdb011e4d4f377c939c1ddd
BLAKE2b-256 aa930b05baafb016173511d019576dac8b862cce3535ab20d5647d5ad70df6cc

See more details on using hashes here.

Supported by

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