Skip to content

Commit 1b78655

Browse files
authored
Refactor DefaultBuzHashConfig for long type support
Signed-off-by: Xen <lordofxen@deskasoft.com>
1 parent 2d7e9c2 commit 1b78655

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

HashifyNet/Algorithms/BuzHash/DefaultBuzHashConfig.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
// ******************************************************************************
2828
// *
2929

30-
using System;
30+
using System.Linq;
3131
using System.Collections.Generic;
3232

3333
namespace HashifyNet.Algorithms.BuzHash
@@ -39,15 +39,15 @@ public class DefaultBuzHashConfig
3939
: IBuzHashConfig
4040
{
4141
/// <summary>
42-
/// Gets a list of <c>256</c> (preferably random and distinct) <see cref="ulong"/> values.
42+
/// Gets a list of <c>256</c> (preferably random and distinct) <see cref="long"/> values.
4343
/// </summary>
4444
/// <value>
45-
/// List of 256 <see cref="ulong"/> values.
45+
/// List of 256 <see cref="long"/> values.
4646
/// </value>
4747
/// <remarks>
4848
/// Defaults to a statically defined, random chosen of values.
4949
/// </remarks>
50-
public IReadOnlyList<ulong> Rtab { get; } = _Rtab;
50+
public IReadOnlyList<long> Rtab { get; } = _Rtab.Select(u => unchecked((long)u)).ToArray();
5151

5252
/// <summary>
5353
/// Gets the desired hash size, in bits.
@@ -69,7 +69,7 @@ public class DefaultBuzHashConfig
6969
/// <remarks>
7070
/// Defaults to <c>0x3CD05367FD0337D3UL</c>
7171
/// </remarks>
72-
public ulong Seed { get; set; } = 0x3CD05367FD0337D3UL;
72+
public long Seed { get; set; } = 0x3CD05367FD0337D3L;
7373

7474
/// <summary>
7575
/// Gets the shift direction.
@@ -151,7 +151,7 @@ public class DefaultBuzHashConfig
151151
};
152152

153153
/// <summary>
154-
/// Makes a deep clone of current instance.
154+
/// Makes a deep clone of the current instance.
155155
/// </summary>
156156
/// <returns>A deep clone of the current instance.</returns>
157157
public IBuzHashConfig Clone() =>

0 commit comments

Comments
 (0)