cs.hashutils


Namecs.hashutils JSON
Version 20240412 PyPI version JSON
download
home_pageNone
SummaryConvenience hashing facilities.
upload_time2024-04-12 05:20:14
maintainerNone
docs_urlNone
authorNone
requires_pythonNone
licenseGNU General Public License v3 or later (GPLv3+)
keywords python3
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            Convenience hashing facilities.

*Latest release 20240412*:
* BaseHashCode.hashclass(hashname): fall back to looking for blake3 from the blake3 module.
* BaseHashCode: new get_hashfunc(hashname) static method.

## Class `BaseHashCode(builtins.bytes)`

Base class for hashcodes, subclassed by `SHA1`, `SHA256` et al.

You can obtain the class for a particular hasher by name, example:

    SHA256 = BaseHashCode.hashclass('sha256')

*Method `BaseHashCode.__str__(self)`*:
Return `f'{self.hashname}:{self.hex()}'`.

*Method `BaseHashCode.from_buffer(bfr: cs.buffer.CornuCopyBuffer)`*:
Compute hashcode from the contents of the `CornuCopyBuffer` `bfr`.

*Method `BaseHashCode.from_data(bs)`*:
Compute hashcode from the data `bs`.

*Method `BaseHashCode.from_fspath(fspath, **kw)`*:
Compute hashcode from the contents of the file `fspath`.

*Method `BaseHashCode.from_hashbytes(hashbytes)`*:
Factory function returning a `BaseHashCode` object from the hash bytes.

*Method `BaseHashCode.from_hashbytes_hex(hashhex: str)`*:
Factory function returning a `BaseHashCode` object
from the hash bytes hex text.

*Method `BaseHashCode.from_named_hashbytes_hex(hashname, hashhex)`*:
Factory function to return a `HashCode` object
from the hash type name and the hash bytes hex text.

*Method `BaseHashCode.from_prefixed_hashbytes_hex(hashtext: str)`*:
Factory function returning a `BaseHashCode` object
from the hash bytes hex text prefixed by the hashname.
This is the reverse of `__str__`.

*Method `BaseHashCode.get_hashfunc(hashname: str)`*:
Fetch the hash function implied by `hashname`.

*Method `BaseHashCode.hashclass(hashname: str, hashfunc=None, **kw)`*:
Return the class for the hash function named `hashname`.

Parameters:
* `hashname`: the name of the hash function
* `hashfunc`: optional hash function for the class

*Property `BaseHashCode.hashname`*:
The hash code type name, derived from the class name.

*Method `BaseHashCode.hex(self) -> str`*:
Return the hashcode bytes transcribes as a hexadecimal ASCII `str`.

*Method `BaseHashCode.promote(obj)`*:
Promote to a `BaseHashCode` instance.

## Class `MD5(BaseHashCode)`

Hash class for the 'md5' algorithm.

*`MD5.hashfunc`*

## Class `SHA1(BaseHashCode)`

Hash class for the 'sha1' algorithm.

*`SHA1.hashfunc`*

## Class `SHA224(BaseHashCode)`

Hash class for the 'sha224' algorithm.

*`SHA224.hashfunc`*

## Class `SHA256(BaseHashCode)`

Hash class for the 'sha256' algorithm.

*`SHA256.hashfunc`*

## Class `SHA384(BaseHashCode)`

Hash class for the 'sha384' algorithm.

*`SHA384.hashfunc`*

## Class `SHA512(BaseHashCode)`

Hash class for the 'sha512' algorithm.

*`SHA512.hashfunc`*

# Release Log



*Release 20240412*:
* BaseHashCode.hashclass(hashname): fall back to looking for blake3 from the blake3 module.
* BaseHashCode: new get_hashfunc(hashname) static method.

*Release 20240316*:
Fixed release upload artifacts.

*Release 20240211*:
Initial PyPI release: BaseHashCode(bytes) and subclasses for various hash algorithms.


            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "cs.hashutils",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "python3",
    "author": null,
    "author_email": "Cameron Simpson <cs@cskk.id.au>",
    "download_url": "https://files.pythonhosted.org/packages/5e/6c/73a369b4b6e50284ac5e59d088c0ce7a4288dd451f5835af60dcbc45c91a/cs.hashutils-20240412.tar.gz",
    "platform": null,
    "description": "Convenience hashing facilities.\n\n*Latest release 20240412*:\n* BaseHashCode.hashclass(hashname): fall back to looking for blake3 from the blake3 module.\n* BaseHashCode: new get_hashfunc(hashname) static method.\n\n## Class `BaseHashCode(builtins.bytes)`\n\nBase class for hashcodes, subclassed by `SHA1`, `SHA256` et al.\n\nYou can obtain the class for a particular hasher by name, example:\n\n    SHA256 = BaseHashCode.hashclass('sha256')\n\n*Method `BaseHashCode.__str__(self)`*:\nReturn `f'{self.hashname}:{self.hex()}'`.\n\n*Method `BaseHashCode.from_buffer(bfr: cs.buffer.CornuCopyBuffer)`*:\nCompute hashcode from the contents of the `CornuCopyBuffer` `bfr`.\n\n*Method `BaseHashCode.from_data(bs)`*:\nCompute hashcode from the data `bs`.\n\n*Method `BaseHashCode.from_fspath(fspath, **kw)`*:\nCompute hashcode from the contents of the file `fspath`.\n\n*Method `BaseHashCode.from_hashbytes(hashbytes)`*:\nFactory function returning a `BaseHashCode` object from the hash bytes.\n\n*Method `BaseHashCode.from_hashbytes_hex(hashhex: str)`*:\nFactory function returning a `BaseHashCode` object\nfrom the hash bytes hex text.\n\n*Method `BaseHashCode.from_named_hashbytes_hex(hashname, hashhex)`*:\nFactory function to return a `HashCode` object\nfrom the hash type name and the hash bytes hex text.\n\n*Method `BaseHashCode.from_prefixed_hashbytes_hex(hashtext: str)`*:\nFactory function returning a `BaseHashCode` object\nfrom the hash bytes hex text prefixed by the hashname.\nThis is the reverse of `__str__`.\n\n*Method `BaseHashCode.get_hashfunc(hashname: str)`*:\nFetch the hash function implied by `hashname`.\n\n*Method `BaseHashCode.hashclass(hashname: str, hashfunc=None, **kw)`*:\nReturn the class for the hash function named `hashname`.\n\nParameters:\n* `hashname`: the name of the hash function\n* `hashfunc`: optional hash function for the class\n\n*Property `BaseHashCode.hashname`*:\nThe hash code type name, derived from the class name.\n\n*Method `BaseHashCode.hex(self) -> str`*:\nReturn the hashcode bytes transcribes as a hexadecimal ASCII `str`.\n\n*Method `BaseHashCode.promote(obj)`*:\nPromote to a `BaseHashCode` instance.\n\n## Class `MD5(BaseHashCode)`\n\nHash class for the 'md5' algorithm.\n\n*`MD5.hashfunc`*\n\n## Class `SHA1(BaseHashCode)`\n\nHash class for the 'sha1' algorithm.\n\n*`SHA1.hashfunc`*\n\n## Class `SHA224(BaseHashCode)`\n\nHash class for the 'sha224' algorithm.\n\n*`SHA224.hashfunc`*\n\n## Class `SHA256(BaseHashCode)`\n\nHash class for the 'sha256' algorithm.\n\n*`SHA256.hashfunc`*\n\n## Class `SHA384(BaseHashCode)`\n\nHash class for the 'sha384' algorithm.\n\n*`SHA384.hashfunc`*\n\n## Class `SHA512(BaseHashCode)`\n\nHash class for the 'sha512' algorithm.\n\n*`SHA512.hashfunc`*\n\n# Release Log\n\n\n\n*Release 20240412*:\n* BaseHashCode.hashclass(hashname): fall back to looking for blake3 from the blake3 module.\n* BaseHashCode: new get_hashfunc(hashname) static method.\n\n*Release 20240316*:\nFixed release upload artifacts.\n\n*Release 20240211*:\nInitial PyPI release: BaseHashCode(bytes) and subclasses for various hash algorithms.\n\n",
    "bugtrack_url": null,
    "license": "GNU General Public License v3 or later (GPLv3+)",
    "summary": "Convenience hashing facilities.",
    "version": "20240412",
    "project_urls": {
        "URL": "https://bitbucket.org/cameron_simpson/css/commits/all"
    },
    "split_keywords": [
        "python3"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "fa0a1219a44e94bfe553a15048f7d6198922ff01a2d2fceb80b6818ce169378c",
                "md5": "468d06eece9d48e7003e925a0b1f386e",
                "sha256": "b9a1f959afab344b24e8cbcaea3444e620982d27fed352dc6c00ba95cc5734a4"
            },
            "downloads": -1,
            "filename": "cs.hashutils-20240412-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "468d06eece9d48e7003e925a0b1f386e",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 4615,
            "upload_time": "2024-04-12T05:20:12",
            "upload_time_iso_8601": "2024-04-12T05:20:12.727344Z",
            "url": "https://files.pythonhosted.org/packages/fa/0a/1219a44e94bfe553a15048f7d6198922ff01a2d2fceb80b6818ce169378c/cs.hashutils-20240412-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5e6c73a369b4b6e50284ac5e59d088c0ce7a4288dd451f5835af60dcbc45c91a",
                "md5": "ba3d98792492b6d7c9cfdac4e052bf1e",
                "sha256": "56079c1f0e3eb24fa2fe3d5c16afbbef49aba8a8d11d633a69f4859f87196ec3"
            },
            "downloads": -1,
            "filename": "cs.hashutils-20240412.tar.gz",
            "has_sig": false,
            "md5_digest": "ba3d98792492b6d7c9cfdac4e052bf1e",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 4476,
            "upload_time": "2024-04-12T05:20:14",
            "upload_time_iso_8601": "2024-04-12T05:20:14.100331Z",
            "url": "https://files.pythonhosted.org/packages/5e/6c/73a369b4b6e50284ac5e59d088c0ce7a4288dd451f5835af60dcbc45c91a/cs.hashutils-20240412.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-12 05:20:14",
    "github": false,
    "gitlab": false,
    "bitbucket": true,
    "codeberg": false,
    "bitbucket_user": "cameron_simpson",
    "bitbucket_project": "css",
    "lcname": "cs.hashutils"
}
        
Elapsed time: 0.22305s