360 Secure SkillHub
360 安全技能中心

Checksum

这是跨平台CLI校验和工具,支持MD5、SHA1等多加密算法,可生成单个文件或递归目录的校验和,支持JSON输出,计划新增校验功能。适用于验证下载文件完整性、检查文件变更、为发布制品生成校验和。通过CLI传入路径、算法等参数,输出文本或JSON格式结果,无需系统依赖。

autogame-17
autogame-17
热度 72.02
最近更新 2026-05-20 03:35:36
分类:安全依赖:代码执行 / 读写文件应用场景:DevOps / 数据处理 / 自动化脚本

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add checksum
Metadata
name
checksum
description
A CLI utility for generating and verifying cryptographic file checksums (MD5, SHA1, SHA256). Supports recursive directory hashing and verification from file.

Checksum Utility

A dedicated CLI tool for ensuring file integrity. Use this skill to verify downloads, check for changes in files, or generate checksums for release artifacts.

Features

  • Multi-Algorithm: Supports md5 (default), sha1, sha256, sha512.
  • Recursive Hashing: Generates checksums for entire directories.
  • Verification: (Planned) Validate files against a checksum list.
  • JSON Output: Machine-readable output for integration scripts.

Usage

Calculate File Checksum

node skills/checksum/index.js --file <path> [--algo <md5|sha1|sha256>]

Example:

node skills/checksum/index.js --file package.json --algo sha256
# Output: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855  package.json

Recursive Directory Checksum

node skills/checksum/index.js --dir <path> [--algo <md5|sha1|sha256>] [--json]

Example:

node skills/checksum/index.js --dir src/ --algo sha1 --json > checksums.json

Why use this instead of md5sum?

  • Cross-Platform: Works on any OS with Node.js (Linux, macOS, Windows).
  • No System Deps: Doesn't rely on coreutils being installed.
  • JSON Support: Easy to parse in other scripts.