Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Git SHA ID 看起来像这样351e11dac558a764ba83f89c6598151d2dbaf904,它是一个长的十六进制数字。但是如何在文本中检测到它呢?搜索仅包含 0-9,af 且长度至少为 20 个字符的“单词”?但是如何区分 SHA ID 和普通单词呢?
351e11dac558a764ba83f89c6598151d2dbaf904
是的,你的方法会奏效。但请记住,SHA1 是一种通用算法(不是特定于 git 的),因此您的文本中可能包含其他 SHA1 哈希值,也可能是 40 个字符的十六进制字符串。