Skip to content

Commit bdcef5d

Browse files
committed
Verify a few tests
1 parent 83491e4 commit bdcef5d

6 files changed

Lines changed: 113 additions & 1 deletion

File tree

Src/FastData.Generator.CPlusPlus.Tests/DataStructures/HashSet_String_3.verified.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class my_data final
2828

2929
static constexpr uint64_t get_hash(const std::string_view value) noexcept
3030
{
31-
{uint64_t hash = 352654597;
31+
uint64_t hash = 352654597;
3232

3333
const char* ptr = value.data();
3434
size_t len = value.size();
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
int length;
2+
int offset;
3+
ulong hash;
4+
length = input;
5+
offset = 0;
6+
length -= offset;
7+
while ((length > 0))
8+
{
9+
if ((length >= 8))
10+
{
11+
hash = (hash + ReadU64(input, offset));
12+
offset += 8;
13+
length -= 8;
14+
}
15+
else
16+
{
17+
if ((length >= 4))
18+
{
19+
hash = (hash + ReadU32(input, offset));
20+
offset += 4;
21+
length -= 4;
22+
}
23+
else
24+
{
25+
if ((length >= 2))
26+
{
27+
hash = (hash + ReadU16(input, offset));
28+
offset += 2;
29+
length -= 2;
30+
}
31+
else
32+
{
33+
hash = (hash + ReadU8(input, offset));
34+
offset += 1;
35+
length -= 1;
36+
}
37+
}
38+
}
39+
}
40+
41+
hash = hash;
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
int length;
2+
int offset;
3+
ulong hash;
4+
length = input;
5+
offset = 1;
6+
hash = (hash + ReadU32(input, offset));
7+
offset += 4;
8+
hash = hash;
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
int length;
2+
int offset;
3+
ulong hash;
4+
offset = 0;
5+
hash = 352654597ul;
6+
length = input;
7+
while ((length > 0))
8+
{
9+
hash = hash = ((((hash << 5) | (hash >> 27)) + hash) ^ ReadU8(input, offset));
10+
offset += 1;
11+
length -= 1;
12+
}
13+
14+
hash = (352654597ul + (hash * 1566083941ul));
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
int length;
2+
int offset;
3+
ulong hash;
4+
length = input;
5+
offset = 0;
6+
length -= offset;
7+
while ((length > 0))
8+
{
9+
if ((length >= 8))
10+
{
11+
hash = (((((hash + ReadU64(input, offset)) + 18397679294719823053ul) ^ (((hash + ReadU64(input, offset)) + 18397679294719823053ul) >> 42)) << 23) | ((((hash + ReadU64(input, offset)) + 18397679294719823053ul) ^ (((hash + ReadU64(input, offset)) + 18397679294719823053ul) >> 42)) >> 41));
12+
offset += 8;
13+
length -= 8;
14+
}
15+
else
16+
{
17+
if ((length >= 4))
18+
{
19+
hash = (((((hash + ReadU32(input, offset)) + 18397679294719823053ul) ^ (((hash + ReadU32(input, offset)) + 18397679294719823053ul) >> 42)) << 23) | ((((hash + ReadU32(input, offset)) + 18397679294719823053ul) ^ (((hash + ReadU32(input, offset)) + 18397679294719823053ul) >> 42)) >> 41));
20+
offset += 4;
21+
length -= 4;
22+
}
23+
else
24+
{
25+
if ((length >= 2))
26+
{
27+
hash = (((((hash + ReadU16(input, offset)) + 18397679294719823053ul) ^ (((hash + ReadU16(input, offset)) + 18397679294719823053ul) >> 42)) << 23) | ((((hash + ReadU16(input, offset)) + 18397679294719823053ul) ^ (((hash + ReadU16(input, offset)) + 18397679294719823053ul) >> 42)) >> 41));
28+
offset += 2;
29+
length -= 2;
30+
}
31+
else
32+
{
33+
hash = (((((hash + ReadU8(input, offset)) + 18397679294719823053ul) ^ (((hash + ReadU8(input, offset)) + 18397679294719823053ul) >> 42)) << 23) | ((((hash + ReadU8(input, offset)) + 18397679294719823053ul) ^ (((hash + ReadU8(input, offset)) + 18397679294719823053ul) >> 42)) >> 41));
34+
offset += 1;
35+
length -= 1;
36+
}
37+
}
38+
}
39+
}
40+
41+
hash = ((((1ul | hash) + (hash * hash)) ^ (((1ul | hash) + (hash * hash)) >> 48)) ^ ((((1ul | hash) + (hash * hash)) ^ (((1ul | hash) + (hash * hash)) >> 48)) >> 46));
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
int length;
2+
int offset;
3+
ulong hash;
4+
length = input;
5+
offset = 1;
6+
hash = (((((hash + ReadU32(input, offset)) + 18397679294719823053ul) ^ (((hash + ReadU32(input, offset)) + 18397679294719823053ul) >> 42)) << 23) | ((((hash + ReadU32(input, offset)) + 18397679294719823053ul) ^ (((hash + ReadU32(input, offset)) + 18397679294719823053ul) >> 42)) >> 41));
7+
offset += 4;
8+
hash = ((((1ul | hash) + (hash * hash)) ^ (((1ul | hash) + (hash * hash)) >> 48)) ^ ((((1ul | hash) + (hash * hash)) ^ (((1ul | hash) + (hash * hash)) >> 48)) >> 46));

0 commit comments

Comments
 (0)