Skip to content
The Chat Archive
claude-sonnet-4-20250514· Anthropic LMArena Human Preference 140K

Gib mir eine Funktion in C#, die aus einem beliebigen String, wie z.B. ABC,…

  1. User

    Gib mir eine Funktion in C#, die aus einem beliebigen String, wie z.B. ABC, reproduzierbar immer dieselbe Guid erstellt. Nur die Methode und sonst nichts.

  2. Assistant
    public static Guid CreateGuidFromString(string input)
    {
        using (var md5 = System.Security.Cryptography.MD5.Create())
        {
            byte[] hash = md5.ComputeHash(System.Text.Encoding.UTF8.GetBytes(input));
            return new Guid(hash);
        }
    }
    

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.