diff --git a/CHANGELOG.md b/CHANGELOG.md index 852bee7..bd0960e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). ## [Unreleased] +### Added + - Added overload to GuidUtils that takes an enumerable of guids and combines them into a new deterministic guid ### Changed - A SafeTimer constructor that executes the callback immediately now does this instead of waiting infinitely diff --git a/ICD.Common.Utils/GuidUtils.cs b/ICD.Common.Utils/GuidUtils.cs index 045c9fa..9edcc31 100644 --- a/ICD.Common.Utils/GuidUtils.cs +++ b/ICD.Common.Utils/GuidUtils.cs @@ -1,4 +1,6 @@ using System; +using System.Collections.Generic; +using ICD.Common.Utils.Extensions; namespace ICD.Common.Utils { @@ -30,5 +32,13 @@ namespace ICD.Common.Utils return new Guid(aBytes); } + + /// + /// Combines the guids in the given order to make a new, deterministic guid. + /// + public static Guid Combine(IEnumerable guids) + { + return guids.AggregateOrDefault(Combine, default(Guid)); + } } }