← 返回
安全合规 中文

File Hasher

Compute, verify, and compare file hashes using MD5, SHA-1, SHA-256, SHA-512, and more. Use when checking file integrity, verifying downloads against expected...
使用 MD5、SHA-1、SHA-256、SHA-512 等算法计算、验证和比较文件哈希值。适用于检查文件完整性及验证下载文件。
johnnywang2001
安全合规 clawhub v1.0.0 1 版本 100000 Key: 无需
★ 0
Stars
📥 461
下载
💾 2
安装
1
版本
#latest

概述

File Hasher

Compute, verify, and compare file hashes. Supports all hashlib algorithms. Zero dependencies.

Quick Start

# Hash a file (SHA-256)
python3 scripts/file_hasher.py hash myfile.txt

# Verify a download
python3 scripts/file_hasher.py verify image.iso -e abc123def456...

# Compare two files
python3 scripts/file_hasher.py compare file1.txt file2.txt

Commands

hash

Compute file hash with one or more algorithms:

python3 scripts/file_hasher.py hash file.txt                        # SHA-256
python3 scripts/file_hasher.py hash file.txt -a md5                 # MD5
python3 scripts/file_hasher.py hash file.txt -a md5,sha1,sha256     # Multiple
python3 scripts/file_hasher.py hash *.py --bsd                      # BSD format
python3 scripts/file_hasher.py hash data.bin --json                 # JSON output

verify

Check a file against an expected hash:

python3 scripts/file_hasher.py verify image.iso -e <expected_hash>
python3 scripts/file_hasher.py verify file.tar.gz -e <hash> -a sha512

Exit code 0 = match, 1 = mismatch.

check

Verify files from a checksum file (sha256sum/md5sum/BSD format):

python3 scripts/file_hasher.py check SHA256SUMS
python3 scripts/file_hasher.py check checksums.txt -a md5

Auto-detects algorithm from hash length and BSD format headers.

compare

Compare two files by hash:

python3 scripts/file_hasher.py compare original.bin copy.bin
python3 scripts/file_hasher.py compare a.txt b.txt -a md5

directory

Hash all files in a directory:

python3 scripts/file_hasher.py directory ./src                  # Top level
python3 scripts/file_hasher.py directory ./project -r           # Recursive
python3 scripts/file_hasher.py directory ./dist -r --bsd -a md5 # BSD + MD5

string

Hash a text string directly:

python3 scripts/file_hasher.py string "hello world"
python3 scripts/file_hasher.py string "password" -a md5,sha256,sha512

algorithms

List all available hash algorithms:

python3 scripts/file_hasher.py algorithms

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-03-30 07:04 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

security-compliance

Skill Vetter

spclaudehome
AI智能体技能安全预审工具。安装ClawdHub、GitHub等来源技能前,检查风险信号、权限范围及可疑模式。
★ 1,212 📥 266,360
productivity

Agent Invoice Generator

johnnywang2001
根据自然语言或结构化数据生成专业的PDF发票,适用于用户请求创建发票、向客户计费或生成收据等场景。
★ 0 📥 648
security-compliance

OpenClaw Backup

alex3alex
备份与恢复 OpenClaw 数据。适用于创建备份、设置自动备份计划、从备份恢复或管理备份轮转。处理 ~/.openclaw 目录归档并包含适当的排除规则。
★ 89 📥 30,599