Introducing Radical.sh

Forget Code launches a powerful code generator for building API's

Getting Hash code in C#

The below code can be used to get hash code for a string.

  1. using System;
  2.  
  3. namespace ConsoleApplication1
  4. {
  5. class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9.  
  10. string name = "code";
  11.  
  12. int value = name.GetHashCode();
  13.  
  14. Console.WriteLine(value);
  15. }
  16.  
  17. }
  18. }

Output:

  1. 1985170611