From 368dca287c6cbb5897e29d78daaad1c01e5d176d Mon Sep 17 00:00:00 2001 From: Alessandro Asoni Date: Mon, 31 Jul 2023 18:12:12 +0200 Subject: [PATCH] Use correct hashcode for identity (#45) * Use correct hashcode for Identity * Sneak a tostring fix into this branch --------- Co-authored-by: Derek Brinkmann --- src/Identity.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Identity.cs b/src/Identity.cs index a703979b8c..90a37cd4b6 100644 --- a/src/Identity.cs +++ b/src/Identity.cs @@ -68,7 +68,12 @@ namespace SpacetimeDB throw new InvalidOperationException("Cannot hash on null bytes."); } - return bytes.GetHashCode(); + return BitConverter.ToInt32(bytes, 0); + } + + public override string ToString() + { + return string.Concat(bytes.Select(b => b.ToString("x2"))); } } }