If using the email processor to file inbound emails on cases via subject, it can file it on the wrong case on even moderately large sites
Came up as a side-thought while testing https://github.com/civicrm/civicrm-core/pull/18624.
On Manage Case, in the case roles section, you can send an outbound email to people by clicking the mail icon. In this context, civi will add a hash to the subject. If you've set up the inbound email processor, you can autofile responses onto cases since it will try to match the hash.
The problem is the algorithm used for the hash stops being unique at some point, and so matches a different case. It turns out you're almost guaranteed hash collisions on a site with 20000 cases. The exact first collision depends on CIVICRM_SITE_KEY which is different for every site. In fact for the site_key on a dev site where I was testing the PR you get the first collision around 11000 cases.
The easy solution is stop using substrings of hashes and just use case id as has been requested several times over the years and there's an extension that does this (self-promo): https://lab.civicrm.org/extensions/caseidinsubject
(Further promo: It also lets you remove the hash completely.)
Civi would still need to accept the 7-character version for inbound emails since there will be a (possibly lengthy) period of time where external recipients will still reply to older emails with the 7-character hash in the subject. But eventually that could be moved to an extension for anyone who wants to support it for longer.
For some background on why it's a hash, I've mentioned in several places that I vaguely recall this being a misunderstanding during initial development. Well-meant, as a privacy thought, but not necessary.
If there's desire to still have a hash, an obvious alternate solution is use a bigger substring or the whole string. In theory this could also be done by an extension.