校验和计算器 Checksum Calculator
计算 CRC32、Adler32 等常见校验和,用于数据完整性检查与调试演示。
Calculate common checksums such as CRC32 and Adler32 for integrity checks and debugging.
1. 输入参数 · Input
3. 使用说明 · Notes
-
这是什么?· What is a checksum?
中文: 校验和(Checksum)是一种把“数据内容”映射成固定长度数值的方式,用于快速发现传输、复制、存储过程中是否发生了意外变化。它更偏“检测错误”,不是“加密”。
English: A checksum maps your data into a fixed-size number to quickly detect accidental changes during transfer/copy/storage. It’s mainly for error detection, not encryption. -
CRC32 vs Adler32 有何区别?· CRC32 vs Adler32
中文: CRC32 更通用、兼容性强,常见于 ZIP/PNG/网络协议等;Adler32 通常更快,但抗碰撞能力更弱,常用于流式校验或性能敏感场景。
English: CRC32 is widely compatible (ZIP/PNG/protocols). Adler32 is typically faster but weaker (more collision-prone), often used in streaming or performance-sensitive checks. -
为什么“同一段文字”算出来不一样?· Why results may differ
中文: 你看到不一致,常见原因不是算法错了,而是“输入字节流不一样”:例如换行符(LF/CRLF)、编码(UTF-8/GBK)、前后空格、是否包含 BOM、是否对内容做了 trim。此工具默认按 UTF-8 计算,并提供「Trim 首尾空白」。
English: Differences are usually caused by different input bytes: line endings (LF/CRLF), encoding (UTF-8/GBK), leading/trailing spaces, BOM, or trimming. This tool uses UTF-8 and offers an optional Trim. -
输出格式怎么选?· Choosing output format
中文: 工程里最常见的是十六进制(HEX),方便对齐文档与命令行工具;十进制(DEC)常见于某些日志或数据库字段。建议日常对外展示用 HEX(大写 + 固定 8 位)。
English: HEX is most common in engineering docs/CLI tools; DEC sometimes appears in logs or DB fields. For sharing, HEX (uppercase + padded to 8) is typically the best. -
这能当“安全校验”吗?· Is this security?
中文: 不能。CRC32/Adler32 并非密码学哈希,不适合防篡改或身份校验。需要安全场景请用 SHA-256 / HMAC(你工具中心已有 HMAC 方向的小工具)。
English: No. CRC32/Adler32 are not cryptographic hashes; they’re not meant for tamper resistance or authentication. For security, use SHA-256 / HMAC instead. -
典型使用场景 · Typical use cases
中文: 1) 文本配置复制前后对比;2) API 返回字段快速验收;3) 把关键内容生成指纹写入日志;4) 演示“换一个字符校验值就变”的完整性概念。
English: 1) Compare config text before/after copy; 2) Quick validation of API payload fields; 3) Log a compact fingerprint; 4) Demonstrate integrity: one character change ⇒ different checksum.
免责声明:本页面仅做学习与工程调试用途,不构成任何安全建议。
Disclaimer: This page is for education and engineering debugging only, and does not constitute security advice.
