Geen omschrijving
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

SolutionGuidGenerator.cs 541B

1234567891011121314151617181920212223
  1. using System;
  2. using System.Security.Cryptography;
  3. using System.Text;
  4. namespace Packages.Rider.Editor.ProjectGeneration
  5. {
  6. internal static class SolutionGuidGenerator
  7. {
  8. public static string GuidForProject(string projectName)
  9. {
  10. return ComputeGuidHashFor(projectName + "salt");
  11. }
  12. private static string ComputeGuidHashFor(string input)
  13. {
  14. using (var md5 = MD5.Create())
  15. {
  16. var hash = md5.ComputeHash(Encoding.Default.GetBytes(input));
  17. return new Guid(hash).ToString();
  18. }
  19. }
  20. }
  21. }