Skip to main content

simple hash library for string, file, dict, set and list

Project description

hashy

Another hash library.

hashy provides an md5, sha256 or sha512 for string, file, dict, list and set.

String and file hashes are conventional and can be compared to other implementations. For example you can go to an online hash calculator for "a" and get the same hash as hashy generates.

Hashes for complex data types like dict, list and set are specific to hashy.

cachy

hashy also provides cachy, a decorator that can be used to persistently cache the results of a function to disk. It is similar to @functools.cache, except:

  • Persistent (saved to local disk)
    • Optionally can be saved to a user-specified directory, otherwise it's the usual cache directory for the OS
  • Optional user-specified cache life.
  • Doesn't require arguments be frozen and/or pickle-able. Uses hashy to create a hash of the arguments.

Example


from hashy import get_string_sha256

print(get_string_sha256("a"))

# prints
# ca978112ca1bbdcafac231b39a23dc4da786eff8147c4e72b9807785afee48bb

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

hashy-0.3.2-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

File details

Details for the file hashy-0.3.2-py3-none-any.whl.

File metadata

  • Download URL: hashy-0.3.2-py3-none-any.whl
  • Upload date:
  • Size: 8.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for hashy-0.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 235d462af2fa2d1fb96baa77ca38006bc8484e8b7a8254b90c84cf70198fa7b9
MD5 613d12fb1cdfeb879034e3e3f039828a
BLAKE2b-256 7edb224db46da63b3f0428540c2b29b71494c5a29844fedf7d6dbc478cbf712e

See more details on using hashes here.

Supported by

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