围绕hashlib和zlib的模块和命令行工具,以便于生成文件的校验和/散列。
fileshash的Python项目详细描述
``文件哈希``
====
…图像::https://img.shields.io/pypi/v/fileshash.svg
:目标:https://pypi.python.org/pypi/fileshash
…图片::https://img.shields.io/travis/mmore500/files hash.svg
:目标:https://travis ci.org/mmore500/fileshash
python模块,便于计算多个文件的哈希。
针对python 2.7、python 3.6、pypy pypy 2.7和pypypy3.5进行测试。
当前支持“adler-32<;https://en.wikipedia.org/wiki/adler-32>;`,` CRC32<;https://en.wikipedia.org/wiki/cyclic_redundancy廑check>;```,`md5<;https://en.wikipedia.org/wiki/md5>;`,`sha-1<;https://en.wikipedia.org/wiki/sha-1>;`,`sha-256和sha-512<;https://en.wikipedia.org/wiki/sha-2>;`,以及`xxhash-32和xxhash-64<;https://xxhash.com>;`.
派生自Leonides T.Saguisag Jr.的“filehash”lt;https://github.com/leonidesgaguisagJr/filehash>;` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` `sha-256和sha-512)和``zlib``(为adler-32和crc32提供校验和)模块,并包含以下方法:
-``hash_file(filename)```-计算单个文件的文件哈希。返回带有十六进制摘要的字符串。
-``cathash_files(filenames)``-todo
-``hophash_files(filenames)``-todo
`` filehash``构造函数有两个可选参数:
-``hash algorithm='sha256'`-指定要使用的哈希算法。
有关支持的哈希算法的列表,请参阅``filehash.supported_algorithms``/校验和算法。
默认值为SHA256。
-`` chunk-size=262144```整数,指定读取文件时要使用的块大小(以字节为单位)。
在处理非常大的文件时,这非常有用,以避免一次将整个文件读入内存。默认块大小为262144字节。
todo
``fileshash``命令行工具
---------------------------
`fileshash``包中还包括一个名为``fileshash``的命令行工具。
下面是一个如何使用该工具的示例:
$todo
获取用法屏幕。
license
----
这是在麻省理工学院的许可下发布的。
有关详细信息,请参阅此存储库中的“license”文件。
====
…图像::https://img.shields.io/pypi/v/fileshash.svg
:目标:https://pypi.python.org/pypi/fileshash
…图片::https://img.shields.io/travis/mmore500/files hash.svg
:目标:https://travis ci.org/mmore500/fileshash
python模块,便于计算多个文件的哈希。
针对python 2.7、python 3.6、pypy pypy 2.7和pypypy3.5进行测试。
当前支持“adler-32<;https://en.wikipedia.org/wiki/adler-32>;`,` CRC32<;https://en.wikipedia.org/wiki/cyclic_redundancy廑check>;```,`md5<;https://en.wikipedia.org/wiki/md5>;`,`sha-1<;https://en.wikipedia.org/wiki/sha-1>;`,`sha-256和sha-512<;https://en.wikipedia.org/wiki/sha-2>;`,以及`xxhash-32和xxhash-64<;https://xxhash.com>;`.
派生自Leonides T.Saguisag Jr.的“filehash”lt;https://github.com/leonidesgaguisagJr/filehash>;` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` `sha-256和sha-512)和``zlib``(为adler-32和crc32提供校验和)模块,并包含以下方法:
-``hash_file(filename)```-计算单个文件的文件哈希。返回带有十六进制摘要的字符串。
-``cathash_files(filenames)``-todo
-``hophash_files(filenames)``-todo
`` filehash``构造函数有两个可选参数:
-``hash algorithm='sha256'`-指定要使用的哈希算法。
有关支持的哈希算法的列表,请参阅``filehash.supported_algorithms``/校验和算法。
默认值为SHA256。
-`` chunk-size=262144```整数,指定读取文件时要使用的块大小(以字节为单位)。
在处理非常大的文件时,这非常有用,以避免一次将整个文件读入内存。默认块大小为262144字节。
todo
``fileshash``命令行工具
---------------------------
`fileshash``包中还包括一个名为``fileshash``的命令行工具。
下面是一个如何使用该工具的示例:
$todo
获取用法屏幕。
license
----
这是在麻省理工学院的许可下发布的。
有关详细信息,请参阅此存储库中的“license”文件。