Created
June 14, 2023 19:37
-
-
Save indy-singh/5d0ab11ad099d5855bc1544985bd605e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void Main(string[] args) | |
{ | |
var murmurHash32 = new MurmurHash32(); | |
var dict = new Dictionary<int, List<string>>(); | |
while (true) | |
{ | |
var s = Guid.NewGuid().ToString(); | |
var bytes = Encoding.UTF8.GetBytes(s); | |
var computeHash = murmurHash32.ComputeHash(bytes); | |
var int32 = BitConverter.ToInt32(computeHash); | |
if (dict.ContainsKey(int32) is false) | |
{ | |
dict[int32] = new List<string>(); | |
} | |
dict[int32].Add(s); | |
if (dict[int32].Count > 1) | |
{ | |
Console.WriteLine(string.Join(",", dict[int32])); | |
} | |
} | |
} |
Author
indy-singh
commented
Jun 14, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment