用于计算校验和的简单命令行实用程序。

hb的Python项目详细描述


散列布朗

CircleCIcodecovLicensePyPI

用于计算校验和的简单命令行实用程序。

安装

pip install hb

用法

计算文件的sha1:

$ hb -a sha1 hello.txt
sha1 (hello.txt) = 493a253abf93d705d67edeb463134a5c8752fc9d

检查文件是否与给定的校验和匹配:

$ hb -a md5 hello.txt -g 77060c267470021a97392b815138733e
md5 (hello.txt) = 77060c267470021a97392b815138733e OK

$ hb -a md5 hello.txt -g 0123456789abcdef
md5 (hello.txt) = 0123456789abcdef BAD

可以从文件中读取校验和:

$ hb -c checksums.txt
sha512 (hello.txt) = 493a253abf93d705d67edeb463134a5c8752fc9d OK
sha512 (world.txt) = 683e4ee04e75e71a6dca42807001f00be1fcb2a3 OK
sha512 (image.jpg) = f3a53e6c2743645f08faedadd7a2c57cbc38632f OK
sha512 (video.mp4) = 03ba9191fc4cd74f218df58542643fbc07dca532 OK

hash brown以bsd样式输出其结果。校验和文件也是bsd样式的。

所有文件都以二进制模式读取。

globbing和递归globbing分别通过***支持。

全局处理时不包括点文件,需要显式指定。

选项

-a, --algorithm [blake2b|blake2s|md5|sha1|sha224|sha256|sha384|sha512|adler32|crc32]
-c, --check                     Read checksums from a file.
-g, --given TEXT                See if the given checksum `TEXT` matches the
                                computed checksum. (use with -a)
-p, --parallel                  Process files in parallel.
-q, --quiet                     Hide results that are OK. (use with -c)
-t, --timer                     Display elapsed time in seconds.
--version                       Show the version and exit.
-h, --help                      Show this message and exit.

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java在EclipseIndigo上安装新的Glassfish服务器   java打印组织的最短方法是什么。w3c。多姆。文件发送到stdout?   安卓 java。lang.NullPointerException:尝试在oncreate方法中的null对象引用上调用virtual方法   linux java,我的线程无一例外地终止了,为什么?   JSON和Lombok构造函数的java问题Jackson反序列化   Spring引导升级后,java无法实例化自定义库的数据源   输入Kotlin中Java Scanner的等价物是什么?   列表vs数组作为java中递归的参数   创建名为“FilterService”的bean时发生java错误:通过字段“filterDAO”表示的未满足的依赖关系   如何在Java(基本上是Android)中将指纹图像的字节数组转换为iso 19794_2?   java如何使用基本适配器单击每个位置   java如何更新数据库显示消息“您的数据库已更新,没有任何错误,但实际上我的数据库未更新”   不同比例的安卓屏幕设备的java程序   java Android For循环,全局静态列表与本地列表