For my Hashes and Salts tutorial, I wondered if there was a way to communicate between all Servers instantly and send them the hashes. My hashing method works by giving every string its own string of random nonsence (a hash). Currently, strings in my server are stored and will always create a hash or output one.
For example, if you input something, it’s output would always be the same. Abc123 → 8J4jwkwa Abc123 → 8J4jwkwa Abc123 → 8J4jwkwa
Of course, each string will have a different hash GermanyNotReal → 2naw1j24 GermanyNotReal → 2naw1j24
But How do I instantly and effiecently communicate between servers on what the hashes are?
Your code is not a hashing algorithm, it’s a random string generator backed by a cache.
You should consider implementing or borrowing a proper hashing algorithm like SHA256 (or lighter one if needed) which don’t require a cache. These are more secure and well tested than a hand roll from someone inexperienced in cryptography.