mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-02-16 21:24:58 +00:00
feat: Add overload to GuidUtils to combine an IEnumerable of guids into a new deterministic guid
This commit is contained in:
committed by
Chris Cameron
parent
d090ab0085
commit
45a3c5c5a1
@@ -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).
|
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
### Added
|
||||||
|
- Added overload to GuidUtils that takes an enumerable of guids and combines them into a new deterministic guid
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
- A SafeTimer constructor that executes the callback immediately now does this instead of waiting infinitely
|
- A SafeTimer constructor that executes the callback immediately now does this instead of waiting infinitely
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using ICD.Common.Utils.Extensions;
|
||||||
|
|
||||||
namespace ICD.Common.Utils
|
namespace ICD.Common.Utils
|
||||||
{
|
{
|
||||||
@@ -30,5 +32,13 @@ namespace ICD.Common.Utils
|
|||||||
|
|
||||||
return new Guid(aBytes);
|
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));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user