We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 69ec4b7 commit ff55382Copy full SHA for ff55382
include/boost/json/detail/digest.hpp
@@ -43,9 +43,20 @@ digest(
43
hash = (batch ^ hash) * prime;
44
}
45
46
- std::uint32_t batch = 0;
47
- std::memcpy(&batch, s, n);
48
- hash = (batch ^ hash) * prime;
+ switch(n)
+ {
+ case 3:
49
+ hash = (*s++ ^ hash) * prime;
50
+ // fall through
51
+ case 2:
52
53
54
+ case 1:
55
56
57
+ default:
58
+ break;
59
+ }
60
61
return hash;
62
0 commit comments