How do I create a HashCode in .net (c#) for a string that is safe to store in a database?
It depends what properties you want that hash to have. For example, you could just write something like this: public int HashString(string text) { // TODO: Determine nullity policy. unchecked { int hash = 23; foreach (char c in text) { hash = hash * 31 + c; } return hash; } } So long … Read more