public static HashCode1024 ToHashCode1024(this IHashValue hashVal, bool strictMode = true) { if (hashVal is null) { return(HashCode1024.Zero); } var hex = hashVal.GetHexString(); return(strictMode ? HashCode1024.Parse(hex) : HashCode1024.ParseLoosely(hex)); }
public static HashCode1024 SafeHashCode1024(this IHashValue hashVal, bool strictMode = true) { if (hashVal is null) { return(HashCode1024.Zero); } var hex = hashVal.GetHexString(); return(strictMode ? HashCode1024.TryParse(hex, out var hash) ? hash : HashCode1024.Zero : HashCode1024.TryParseLoosely(hex, out hash) ? hash : HashCode1024.Zero); }