Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 18 additions & 18 deletions GameFrameX.Foundation.Hash/XxHashHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public static uint Hash32(string text)
public static uint Hash32(Type type)
{
ArgumentNullException.ThrowIfNull(type, nameof(type));
return InternalXxHashHelper.Hash32(type);
return InternalXxHashHelper.ComputeHash32(type);
}

/// <summary>
Expand All @@ -111,7 +111,7 @@ public static uint Hash32(Type type)
/// <returns>32位无符号整数形式的哈希值 / The 32-bit hash value as an unsigned integer</returns>
public static uint Hash32<T>()
{
return InternalXxHashHelper.Hash32<T>();
return InternalXxHashHelper.ComputeHash32<T>();
}

/// <summary>
Expand Down Expand Up @@ -160,7 +160,7 @@ public static ulong Hash64(string text)
public static ulong Hash64(Type type)
{
ArgumentNullException.ThrowIfNull(type, nameof(type));
return InternalXxHashHelper.Hash64(type);
return InternalXxHashHelper.ComputeHash64(type);
}

/// <summary>
Expand All @@ -175,7 +175,7 @@ public static ulong Hash64(Type type)
/// <returns>64位无符号整数形式的哈希值 / The 64-bit hash value as an unsigned integer</returns>
public static ulong Hash64<T>()
{
return InternalXxHashHelper.Hash64<T>();
return InternalXxHashHelper.ComputeHash64<T>();
}

/// <summary>
Expand Down Expand Up @@ -480,7 +480,7 @@ private static unsafe ulong Hash64(byte* input, int length, uint seed = 0)
/// <returns>32位无符号整数形式的哈希值 / The 32-bit hash value as an unsigned integer</returns>
/// <exception cref="ArgumentNullException">当 <paramref name="buffer"/> 为 null 时抛出 / Thrown when <paramref name="buffer"/> is null</exception>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static uint Hash32(byte[] buffer)
public static uint ComputeHash32(byte[] buffer)
{
ArgumentNullException.ThrowIfNull(buffer, nameof(buffer));
var length = buffer.Length;
Expand All @@ -503,10 +503,10 @@ public static uint Hash32(byte[] buffer)
/// <returns>32位无符号整数形式的哈希值 / The 32-bit hash value as an unsigned integer</returns>
/// <exception cref="ArgumentNullException">当 <paramref name="text"/> 为 null 时抛出 / Thrown when <paramref name="text"/> is null</exception>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static uint Hash32(string text)
public static uint ComputeHash32(string text)
{
ArgumentNullException.ThrowIfNull(text, nameof(text));
return Hash32(Encoding.UTF8.GetBytes(text));
return ComputeHash32(Encoding.UTF8.GetBytes(text));
}

/// <summary>
Expand All @@ -519,10 +519,10 @@ public static uint Hash32(string text)
/// <returns>32位无符号整数形式的哈希值 / The 32-bit hash value as an unsigned integer</returns>
/// <exception cref="ArgumentNullException">当 <paramref name="type"/> 为 null 时抛出 / Thrown when <paramref name="type"/> is null</exception>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static uint Hash32(Type type)
public static uint ComputeHash32(Type type)
{
ArgumentNullException.ThrowIfNull(type, nameof(type));
return Hash32(type.FullName);
return ComputeHash32(type.FullName);
}

/// <summary>
Expand All @@ -532,9 +532,9 @@ public static uint Hash32(Type type)
/// Computes a 32-bit hash value for a generic type.
/// </remarks>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static uint Hash32<T>()
public static uint ComputeHash32<T>()
{
return Hash32(typeof(T));
return ComputeHash32(typeof(T));
}

/// <summary>
Expand All @@ -547,7 +547,7 @@ public static uint Hash32<T>()
/// <returns>64位无符号整数形式的哈希值 / The 64-bit hash value as an unsigned integer</returns>
/// <exception cref="ArgumentNullException">当 <paramref name="buffer"/> 为 null 时抛出 / Thrown when <paramref name="buffer"/> is null</exception>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static ulong Hash64(byte[] buffer)
public static ulong ComputeHash64(byte[] buffer)
{
ArgumentNullException.ThrowIfNull(buffer, nameof(buffer));
var length = buffer.Length;
Expand All @@ -570,10 +570,10 @@ public static ulong Hash64(byte[] buffer)
/// <returns>64位无符号整数形式的哈希值 / The 64-bit hash value as an unsigned integer</returns>
/// <exception cref="ArgumentNullException">当 <paramref name="text"/> 为 null 时抛出 / Thrown when <paramref name="text"/> is null</exception>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static ulong Hash64(string text)
public static ulong ComputeHash64(string text)
{
ArgumentNullException.ThrowIfNull(text, nameof(text));
return Hash64(Encoding.UTF8.GetBytes(text));
return ComputeHash64(Encoding.UTF8.GetBytes(text));
}

/// <summary>
Expand All @@ -586,10 +586,10 @@ public static ulong Hash64(string text)
/// <returns>64位无符号整数形式的哈希值 / The 64-bit hash value as an unsigned integer</returns>
/// <exception cref="ArgumentNullException">当 <paramref name="type"/> 为 null 时抛出 / Thrown when <paramref name="type"/> is null</exception>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static ulong Hash64(Type type)
public static ulong ComputeHash64(Type type)
{
ArgumentNullException.ThrowIfNull(type, nameof(type));
return Hash64(type.FullName);
return ComputeHash64(type.FullName);
}

/// <summary>
Expand All @@ -599,9 +599,9 @@ public static ulong Hash64(Type type)
/// Computes a 64-bit hash value for a generic type.
/// </remarks>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static ulong Hash64<T>()
public static ulong ComputeHash64<T>()
{
return Hash64(typeof(T));
return ComputeHash64(typeof(T));
}
}
}