# 哈希碰撞

> **最後更新：2026 年 1 月**

RIPE-MD160.\
\
2^160 is 1,461,501,637,330,902,918,203,684,832,716,283,019,655,932,542,976

## 怎麼可能一直有獨特值

你可能已經發現，對[哈希函數](/gei-kai-fa-zhe-de-zhi-nan/cryptography/hash.md)而言，輸入的區間若是無限大，而輸出區間僅是固定長度的編號的話，一定會發現兩個完全不同的輸入得出相同的[哈希值](/qu-kuai-lian-ru-he-da-cheng-gong-shi/wa/ha-xi-zhi.md)。這類情況稱為碰撞，比方說輸入"丁手中"得到哈希值"0x666666"，然而卻發現"顆P"的哈希值竟然剛好也是"0x666666"，如此一來，從哈希值來看，我們就會無法判斷台北的未來到底在誰手中了。

## 碰撞怎麼辦

一個好的哈希函數理論上會努力減低碰撞被發現的可能性。通常偶爾發現的碰撞並不會影響哈希函數的可用性，除非多餘一個碰撞被發現，大家才會開始淘汰使用這個哈希函數。

***

#### 相關條目

* [哈希算法](/gei-kai-fa-zhe-de-zhi-nan/cryptography/hash.md)
* [SHA256](/gei-kai-fa-zhe-de-zhi-nan/cryptography/sha256.md)

#### 參考資料


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://www.0x1.academy/gei-kai-fa-zhe-de-zhi-nan/cryptography/peng-zhuang.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
