Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
dlib
Commits
6335f110
Commit
6335f110
authored
May 28, 2011
by
Davis King
Browse files
minor cleanup
parent
cd3819da
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
7 deletions
+1
-7
dlib/test/hash.cpp
dlib/test/hash.cpp
+1
-7
No files found.
dlib/test/hash.cpp
View file @
6335f110
...
@@ -57,8 +57,7 @@ namespace
...
@@ -57,8 +57,7 @@ namespace
memset
(
hashes
,
0
,
sizeof
(
hashes
));
memset
(
hashes
,
0
,
sizeof
(
hashes
));
// Hash keys of the form {0}, {0,1}, {0,1,2}... up to N=255,using 256-N as
// Hash keys of the form {0}, {0,1}, {0,1,2}... up to N=255,using 256-N as
// the seed
// the seed.
for
(
int
i
=
0
;
i
<
256
;
i
++
)
for
(
int
i
=
0
;
i
<
256
;
i
++
)
{
{
key
[
i
]
=
(
uint8
)
i
;
key
[
i
]
=
(
uint8
)
i
;
...
@@ -68,15 +67,10 @@ namespace
...
@@ -68,15 +67,10 @@ namespace
byte_orderer
bo
;
byte_orderer
bo
;
bo
.
host_to_little
(
hashes
);
bo
.
host_to_little
(
hashes
);
// Then hash the result array
final
=
murmur_hash3
(
hashes
,
sizeof
(
hashes
),
0
);
final
=
murmur_hash3
(
hashes
,
sizeof
(
hashes
),
0
);
// The first four bytes of that hash, interpreted as a little-endian integer, is our
// verification value
dlog
<<
LINFO
<<
hex
<<
"final: "
<<
final
;
dlog
<<
LINFO
<<
hex
<<
"final: "
<<
final
;
DLIB_TEST
(
final
==
0xB0F57EE3
);
DLIB_TEST
(
final
==
0xB0F57EE3
);
}
}
class
test_hash
:
public
tester
class
test_hash
:
public
tester
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment