hashy


Namehashy JSON
Version 0.3.2 PyPI version JSON
download
home_pagehttps://github.com/jamesabel/hashy
Summarysimple hash library for string, file, dict, set and list
upload_time2024-01-01 05:57:23
maintainer
docs_urlNone
authorabel
requires_python
licenseMIT License
keywords hash
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage
            
# 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

```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/jamesabel/hashy",
    "name": "hashy",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "hash",
    "author": "abel",
    "author_email": "j@abel.co",
    "download_url": "https://github.com/jamesabel/hashy",
    "platform": null,
    "description": "\r\n# hashy\r\n\r\nAnother hash library.\r\n\r\nhashy provides an md5, sha256 or sha512 for string, file, dict, list and set.\r\n\r\nString and file hashes are conventional and can be compared to other implementations. For example\r\nyou can go to an online hash calculator for \"a\" and get the same hash as hashy generates.\r\n\r\nHashes for complex data types like dict, list and set are specific to hashy.\r\n\r\n## cachy\r\n\r\n`hashy` also provides `cachy`, a decorator that can be used to persistently cache the results of a function to \r\ndisk. It is similar to `@functools.cache`, except:\r\n\r\n- Persistent (saved to local disk)\r\n  - Optionally can be saved to a user-specified directory, otherwise it's the usual cache directory for the OS\r\n- Optional user-specified cache life.\r\n- Doesn't require arguments be frozen and/or pickle-able. Uses hashy to create a hash of the arguments.\r\n\r\n\r\n# Example\r\n\r\n```\r\n\r\nfrom hashy import get_string_sha256\r\n\r\nprint(get_string_sha256(\"a\"))\r\n\r\n# prints\r\n# ca978112ca1bbdcafac231b39a23dc4da786eff8147c4e72b9807785afee48bb\r\n\r\n```\r\n",
    "bugtrack_url": null,
    "license": "MIT License",
    "summary": "simple hash library for string, file, dict, set and list",
    "version": "0.3.2",
    "project_urls": {
        "Download": "https://github.com/jamesabel/hashy",
        "Homepage": "https://github.com/jamesabel/hashy"
    },
    "split_keywords": [
        "hash"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "7edb224db46da63b3f0428540c2b29b71494c5a29844fedf7d6dbc478cbf712e",
                "md5": "613d12fb1cdfeb879034e3e3f039828a",
                "sha256": "235d462af2fa2d1fb96baa77ca38006bc8484e8b7a8254b90c84cf70198fa7b9"
            },
            "downloads": -1,
            "filename": "hashy-0.3.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "613d12fb1cdfeb879034e3e3f039828a",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 8115,
            "upload_time": "2024-01-01T05:57:23",
            "upload_time_iso_8601": "2024-01-01T05:57:23.917059Z",
            "url": "https://files.pythonhosted.org/packages/7e/db/224db46da63b3f0428540c2b29b71494c5a29844fedf7d6dbc478cbf712e/hashy-0.3.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-01-01 05:57:23",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "jamesabel",
    "github_project": "hashy",
    "travis_ci": false,
    "coveralls": true,
    "github_actions": true,
    "lcname": "hashy"
}
        
Elapsed time: 0.24403s