fork download
  1. using System;
  2.  
  3. public class Program
  4. {
  5. public static void Main()
  6. {
  7. Console.WriteLine("Enter UUID:");
  8. string input = Console.ReadLine();
  9.  
  10. if (Guid.TryParse(input, out Guid guid))
  11. {
  12. byte[] bytes = guid.ToByteArray();
  13. Console.WriteLine("Byte array in hex:");
  14. foreach (byte b in bytes)
  15. {
  16. Console.Write($"{b:X2} ");
  17. }
  18. }
  19. else
  20. {
  21. Console.WriteLine("Invalid UUID format.");
  22. }
  23. }
  24. }
  25.  
Success #stdin #stdout 0.08s 29316KB
stdin
01020304-1011-2021-3031-414243444346
stdout
Enter UUID:
Byte array in hex:
04 03 02 01 11 10 21 20 30 31 41 42 43 44 43 46