From 87d1f4da166c91088de560bad636a68239fa5fc7 Mon Sep 17 00:00:00 2001 From: Chris Cameron Date: Tue, 26 Mar 2019 11:28:59 -0400 Subject: [PATCH] feat: Added util method for generating seeded guids --- ICD.Common.Utils/GuidUtils.cs | 17 +++++++++++++++++ .../ICD.Common.Utils_SimplSharp.csproj | 1 + 2 files changed, 18 insertions(+) create mode 100644 ICD.Common.Utils/GuidUtils.cs diff --git a/ICD.Common.Utils/GuidUtils.cs b/ICD.Common.Utils/GuidUtils.cs new file mode 100644 index 0000000..d68feb6 --- /dev/null +++ b/ICD.Common.Utils/GuidUtils.cs @@ -0,0 +1,17 @@ +using System; + +namespace ICD.Common.Utils +{ + public static class GuidUtils + { + public static Guid GenerateSeeded(int seed) + { + Random seeded = new Random(seed); + byte[] bytes = new byte[16]; + + seeded.NextBytes(bytes); + + return new Guid(bytes); + } + } +} diff --git a/ICD.Common.Utils/ICD.Common.Utils_SimplSharp.csproj b/ICD.Common.Utils/ICD.Common.Utils_SimplSharp.csproj index 103d153..297b013 100644 --- a/ICD.Common.Utils/ICD.Common.Utils_SimplSharp.csproj +++ b/ICD.Common.Utils/ICD.Common.Utils_SimplSharp.csproj @@ -112,6 +112,7 @@ +