Text Fingerprint Generator|文本指纹生成器

文本指纹生成器 | Text Fingerprint Generator

文本指纹生成器 Text Fingerprint Generator

为任意文本生成可复现的“指纹”(Fingerprint),用于快速判断文本是否发生变化、是否与另一段文本完全一致。
Generate a reproducible fingerprint for any text, so you can quickly detect changes or verify exact equality.

1. 输入参数 · Input
提示:如果你只想比较“内容是否一样”,建议开启“统一换行符”和“去除首尾空白”。
Tip: If your goal is change detection, enable “Normalize line endings” and “Trim”.
指纹会对“文本内容 + 规范化规则 + 算法选择”共同决定。
The fingerprint depends on your text, normalization rules, and chosen algorithm.

同一段文本在不同系统中可能存在不同换行符(CRLF / LF),这会导致指纹不同。
Line endings may differ across systems (CRLF vs LF), which can change the fingerprint.
“合并连续空白”会把多个空格、Tab、换行等视为一个空格,适合做“语义相近”的粗略比对,但不适合代码/配置文本。
“Collapse whitespace” treats repeated spaces/tabs/newlines as one space—useful for fuzzy comparison, but not recommended for code/config.
常见推荐 · Recommended:
✅ 文档/公告比对:Trim + Normalize EOL
✅ 纯英文句子比对:可加 Lowercase
⚠️ 代码/JSON/YAML:建议只开 Normalize EOL(谨慎开启 Collapse)

你选择的规则不同,指纹就不同——这是正常的。
Different rules lead to different fingerprints — that’s expected.
SHA 系列属于“加密哈希”(用于稳定摘要);FNV-1a 属于“非加密哈希”(更快但抗碰撞更弱)。
SHA family are cryptographic hashes; FNV-1a is non-cryptographic (fast but weaker collision resistance).
选择建议 · How to choose:
– 需要可靠比对:SHA-256
– 只做快速变更检测(低风险场景):FNV-1a 64-bit

“Short” 只是展示截断,适合界面阅读,不适合当作唯一标识。
“Short” is truncated for readability; don’t use it as the only identifier.
WebCrypto: 检测中… / Checking…
开启后会同时生成 A / B 两个指纹,并给出“是否一致”的结论。
When enabled, the tool generates fingerprints for A and B and tells you whether they match.

注意:只要有一个字符不同(包括空格、换行),在未开启相关规范化时就会判定不同。
Note: even one character difference (space/newline) matters unless normalized.
长度: – / Length: –
3. 使用说明 · Notes
这是什么? 文本指纹(Fingerprint)就是对文本做一次稳定的“摘要计算”,得到一串短而固定长度的结果。
What is this? A text fingerprint is a stable digest (summary) of your text, producing a fixed-length result.
  • 用途 1:快速检测是否变更 · Use case 1: change detection
    你可以把某段文本的指纹保存起来(例如记录在日志、版本说明、数据库字段中),下次再生成一次指纹,比较两次指纹是否相等:相等通常意味着文本完全一致。
    Save a fingerprint in logs/version notes/db fields, then regenerate later—if the fingerprints match, the text is usually identical.
  • 用途 2:对比两段文本是否一致 · Use case 2: equality check
    打开“对比模式”,粘贴 A 与 B 两段文本,本工具会在相同规则下生成两份指纹,并给出结论。它比肉眼对比更快,尤其适合长文本、配置、接口返回等。
    Enable Compare Mode and paste text A and B. The tool computes fingerprints using the same rules and tells you whether they match—great for long texts/configs/API responses.
  • 关于空格/换行 · About whitespace and line endings
    “看起来一样”的文本,可能在内部不一样:比如多了一个空格、Tab,或者 Windows 的 CRLF 与 Linux 的 LF。
    Two texts may look the same but differ internally (extra spaces/tabs, CRLF vs LF).
    因此建议在跨平台复制粘贴时开启“统一换行符”,在粘贴时容易带空白时开启“Trim”。
    For cross-platform copy/paste, enable Normalize line endings; enable Trim when pasted text may contain leading/trailing blanks.
  • SHA-256 vs FNV-1a · Which algorithm?
    SHA-256: 更通用、更稳妥、抗碰撞更强,适合当作“内容唯一摘要”。
    SHA-256: Safer and more universal; better collision resistance—best default choice.
    FNV-1a 64-bit: 速度快、实现简单,适合低风险的“快速变更检测”,但不建议用于安全场景或作为强唯一 ID。
    FNV-1a 64-bit: Very fast for quick checks, but weaker collision resistance—avoid for security-critical uses.
  • 输出格式 · Output formats
    Hex 最常见、可读性好;Base64 更短;Base64URL 适合放到 URL 或文件名里(更少特殊字符)。
    Hex is common and readable; Base64 is shorter; Base64URL is safer for URLs/filenames (fewer special characters).
    “Short” 只为界面展示方便,会截断中间内容,不适合长期存档。
    “Short” is truncated for UI readability—do not use it for archival identification.
  • 隐私与安全 · Privacy & security
    本工具在浏览器本地计算,不上传文本到服务器(除非你自行把它粘贴到其他地方)。
    Everything is computed locally in your browser; no server upload (unless you paste it elsewhere).
    但指纹也可能泄露信息(例如可被用来验证某段文本是否出现过),敏感文本请谨慎传播指纹。
    Fingerprints can still leak information (e.g., verifying whether a text existed). Be cautious with sensitive content.
  • 兼容性提示 · Compatibility note
    SHA 系列使用浏览器的 WebCrypto API。部分浏览器/环境(如非 HTTPS 或受限环境)可能不可用,此时你仍可选择 FNV-1a。
    SHA uses the browser WebCrypto API. In some restricted contexts (e.g., non-HTTPS or limited environments), it may be unavailable—use FNV-1a as a fallback.

免责声明:本工具用于学习、调试与快速比对参考,不构成任何安全承诺或合规保证。请不要把非加密算法当作密码学用途。
Disclaimer: For learning/debugging/change-check purposes only. Do not treat non-cryptographic hashes as cryptographic guarantees.