Skip to main content

No project description provided

Project description

This custom-made hashing algorithm is ASCII based Algorithm, where set of operations are performed onto the ASCII value of the input string and then once those operations are completed the resulting values are converted back into printable characters by mapping the value (modified ASCII) to its corresponding character.

  1. Working of this Hashing Algorithm: ASCII Conversion: The function first converts each character in the input string to its ASCII value and stores these values in a list called asci.
  2. Transformation Step 1: Each ASCII value is then transformed by multiplying it by 3 and adding 1.
  3. Transformation Step 2: Each resulting value from the previous step is divided by 2.45.
  4. Normalization: The normalize_to_range function normalizes the transformed ASCII values to a specified range (33 to 126 in this case, corresponding to printable ASCII characters). This ensures that the final ASCII values can be converted back to printable characters.
  5. Length Adjustment and Modulation: The code then creates a new list, final_asci1, by looping over the normalized ASCII values. It ensures the list has the same length as specified by the length parameter. For each index, it calculates a new value by adding the index to the corresponding ASCII value, modulo 94 (to keep it within the printable ASCII range), and then adding 33 to shift it back into the printable range.
  6. Summation and Condition: The sum of the elements in final_asci1 is calculated. Then the sum of the digits of this sum is found (digit_sum). Depending on the value of digit_sum modulo 7, one of three different transformations is applied to create a new list, final_asci2: • If digit_sum % 7 is 0, each value is multiplied by its index (plus one), modulo 94, plus 33. • If digit_sum % 7 is 1, 3, or 5, each value is raised to the power of (index + 2), modulo 94, plus 33. • Otherwise, the absolute difference between each value and its index is taken, modulo 94, plus 33.
  7. Character Conversion: The values in final_asci2 are converted back to characters using the chr function.
  8. Final Hash Generation: The characters are concatenated to form the final hashed string, which is returned by the function.

Examples:

  1. Input: Naman, 15 Output: “Xc:;C89n3K:]t}k”

  2. Input: naman, 15 Output: “AA7?=<<2:877-53”

  3. Input: MMCOE, 15 Output: “10@>M,+;9H'&64C”

  4. Input: mMMCoE, 15 Output: “h/%|CR$3A0=*bSe”

Above are few Examples of the Hashes generated for the given input of the data. Also, the examples show the Avalanche Effect, which is that changing of one-character results in generation of entirely new hash even if its just a difference of uppercase and lowercase.

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

nashx-0.1.tar.gz (2.9 kB view details)

Uploaded Source

Built Distribution

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

nashx-0.1-py3-none-any.whl (3.3 kB view details)

Uploaded Python 3

File details

Details for the file nashx-0.1.tar.gz.

File metadata

  • Download URL: nashx-0.1.tar.gz
  • Upload date:
  • Size: 2.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.10.0

File hashes

Hashes for nashx-0.1.tar.gz
Algorithm Hash digest
SHA256 51b7e02e3dd4a022178f8374108333ec79157875311370f6b524101eecdfe17d
MD5 ab2a36deb6550ce754dcdef58b6b5538
BLAKE2b-256 f162b83f01731f343c0a9e2c500d449ba95a753e1d57accf6366daf8bb356f16

See more details on using hashes here.

File details

Details for the file nashx-0.1-py3-none-any.whl.

File metadata

  • Download URL: nashx-0.1-py3-none-any.whl
  • Upload date:
  • Size: 3.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.10.0

File hashes

Hashes for nashx-0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ff913b6e17e01d3268d172f654bbaa0b8f726b6ff6ab705d5035be45bd0df28f
MD5 fee77cbfa2fdca9e3871b90d8f6cf0e9
BLAKE2b-256 57ed9e1ba31558dbfbe9d212359c1e784615f7fd3b88dd70a4acc6bb1fea3592

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