mirror of
https://github.com/Sea-Haven-Industries/shoc-backend.git
synced 2026-09-30 04:53:11 +00:00
22 lines
658 B
C#
22 lines
658 B
C#
using System.Security.Cryptography;
|
|
using System.Text;
|
|
|
|
namespace SeaHaven.Services.Helpers
|
|
{
|
|
public static class WorkOrderExternalVersion
|
|
{
|
|
public static string Compute(params string?[] values)
|
|
{
|
|
var buffer = new StringBuilder();
|
|
foreach (var value in values)
|
|
{
|
|
var normalized = value ?? string.Empty;
|
|
buffer.Append(normalized.Length).Append(':').Append(normalized).Append('|');
|
|
}
|
|
|
|
return Convert.ToHexString(
|
|
SHA256.HashData(Encoding.UTF8.GetBytes(buffer.ToString())))
|
|
.ToLowerInvariant();
|
|
}
|
|
}
|
|
}
|