Version: 2021.2
public static void ComputeHash128 (byte[] value, ref Hash128 hash);
public static void ComputeHash128 (ref T value, ref Hash128 hash);

参数

value 对要计算哈希的值的引用。
hash 对用哈希计算结果更新的 Hash128 的引用。

描述

根据值计算 128 位哈希。值的类型必须是值类型。

using UnityEngine;
using System.Runtime.InteropServices;

public class HashUtilitiesSample { [StructLayout(LayoutKind.Sequential)] struct TestData { public ulong V1; public ulong V2; }

public void ComputeHash128_ToHash128() { var message = new TestData { V1 = 0x73BC2A67F, V2 = 0x54B1A5C2C };

Hash128 hash = new Hash128(); HashUtilities.ComputeHash128(ref message, ref hash); } }