We can compute an insecure hash with fairly low probability of collision with the following algorithm:
public string SimpleHash(string seed, int halfHashLength)
{
if(seed == null) throw new ArgumentNullException(nameof(seed));
if(halfHashLength <= 0) throw new ArgumentException("Value should be larger than 0.", nameof(halfHashLength));
// Use different random algo for more deterministic hash:
// https://stackoverflow.com/questions/17094189/crossplatform-random-number-generator
Random rnd = new Random(seed.GetHashCode());
byte[] tmp = new byte[halfHashLength];
rnd.NextBytes(tmp);
StringBuilder sb = new StringBuilder();
for (int i = 0; i < tmp.Length; i++)
{
sb.Append(tmp[i].ToString("X2"));
}
return sb.ToString();
}
Note that the the above computed hash may not be portable across runtimes and possibly not even between runtime restarts (.NET Core will return a different seed.GetHashCode() each time the runtime is restarted). Use a more deterministic hashing algorithm if this is a problem.