feat: Add overload to GuidUtils to combine an IEnumerable of guids into a new deterministic guid

This commit is contained in:
Austin Noska
2021-01-19 15:52:50 -05:00
committed by Chris Cameron
parent d090ab0085
commit 45a3c5c5a1
2 changed files with 12 additions and 0 deletions

View File

@@ -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

View File

@@ -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);
}
/// <summary>
/// Combines the guids in the given order to make a new, deterministic guid.
/// </summary>
public static Guid Combine(IEnumerable<Guid> guids)
{
return guids.AggregateOrDefault(Combine, default(Guid));
}
}
}