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
3785d320
"src/git@developer.sourcefind.cn:OpenDAS/dgl.git" did not exist on "4f7972957b02088b13c9d23d71646d2d0bab3e4e"
Commit
3785d320
authored
May 28, 2011
by
Davis King
Browse files
Added comments regarding endianness and hashing.
parent
a68c27be
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
0 deletions
+37
-0
dlib/general_hash/hash_abstract.h
dlib/general_hash/hash_abstract.h
+29
-0
dlib/matrix/matrix_utilities_abstract.h
dlib/matrix/matrix_utilities_abstract.h
+8
-0
No files found.
dlib/general_hash/hash_abstract.h
View file @
3785d320
...
@@ -37,6 +37,11 @@ namespace dlib
...
@@ -37,6 +37,11 @@ namespace dlib
- Each value of seed results in a different hash function being used.
- Each value of seed results in a different hash function being used.
(e.g. hash(item,0) should generally not be equal to hash(item,1))
(e.g. hash(item,0) should generally not be equal to hash(item,1))
- uses the murmur_hash3() routine to compute the actual hash.
- uses the murmur_hash3() routine to compute the actual hash.
- Note that the returned hash value will be different on big-endian and
little-endian systems since hash() doesn't attempt to perform any byte
swapping of the data contained in item. If you want to always obtain
the same hash then you need to byte swap the elements of item before
passing it to hash().
!*/
!*/
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------
...
@@ -47,11 +52,19 @@ namespace dlib
...
@@ -47,11 +52,19 @@ namespace dlib
uint32
seed
=
0
uint32
seed
=
0
);
);
/*!
/*!
requires
- T is a standard layout type (e.g. a POD type like int, float,
or a simple struct).
ensures
ensures
- returns a 32bit hash of the data stored in item.
- returns a 32bit hash of the data stored in item.
- Each value of seed results in a different hash function being used.
- Each value of seed results in a different hash function being used.
(e.g. hash(item,0) should generally not be equal to hash(item,1))
(e.g. hash(item,0) should generally not be equal to hash(item,1))
- uses the murmur_hash3() routine to compute the actual hash.
- uses the murmur_hash3() routine to compute the actual hash.
- Note that the returned hash value will be different on big-endian and
little-endian systems since hash() doesn't attempt to perform any byte
swapping of the data contained in item. If you want to always obtain
the same hash then you need to byte swap the elements of item before
passing it to hash().
!*/
!*/
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------
...
@@ -62,11 +75,19 @@ namespace dlib
...
@@ -62,11 +75,19 @@ namespace dlib
uint32
seed
=
0
uint32
seed
=
0
);
);
/*!
/*!
requires
- T and U are standard layout types (e.g. POD types like int, float,
or simple structs).
ensures
ensures
- returns a 32bit hash of the data stored in item.
- returns a 32bit hash of the data stored in item.
- Each value of seed results in a different hash function being used.
- Each value of seed results in a different hash function being used.
(e.g. hash(item,0) should generally not be equal to hash(item,1))
(e.g. hash(item,0) should generally not be equal to hash(item,1))
- uses the murmur_hash3() routine to compute the actual hash.
- uses the murmur_hash3() routine to compute the actual hash.
- Note that the returned hash value will be different on big-endian and
little-endian systems since hash() doesn't attempt to perform any byte
swapping of the data contained in item. If you want to always obtain
the same hash then you need to byte swap the elements of item before
passing it to hash().
!*/
!*/
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------
...
@@ -77,11 +98,19 @@ namespace dlib
...
@@ -77,11 +98,19 @@ namespace dlib
uint32
seed
=
0
uint32
seed
=
0
);
);
/*!
/*!
requires
- T and U are standard layout types (e.g. POD types like int, float,
or simple structs).
ensures
ensures
- returns a 32bit hash of the data stored in item.
- returns a 32bit hash of the data stored in item.
- Each value of seed results in a different hash function being used.
- Each value of seed results in a different hash function being used.
(e.g. hash(item,0) should generally not be equal to hash(item,1))
(e.g. hash(item,0) should generally not be equal to hash(item,1))
- uses the murmur_hash3() routine to compute the actual hash.
- uses the murmur_hash3() routine to compute the actual hash.
- Note that the returned hash value will be different on big-endian and
little-endian systems since hash() doesn't attempt to perform any byte
swapping of the data contained in item. If you want to always obtain
the same hash then you need to byte swap the elements of item before
passing it to hash().
!*/
!*/
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------
...
...
dlib/matrix/matrix_utilities_abstract.h
View file @
3785d320
...
@@ -705,11 +705,19 @@ namespace dlib
...
@@ -705,11 +705,19 @@ namespace dlib
uint32
seed
=
0
uint32
seed
=
0
);
);
/*!
/*!
requires
- T is a standard layout type (e.g. a POD type like int, float,
or a simple struct).
ensures
ensures
- returns a 32bit hash of the data stored in item.
- returns a 32bit hash of the data stored in item.
- Each value of seed results in a different hash function being used.
- Each value of seed results in a different hash function being used.
(e.g. hash(item,0) should generally not be equal to hash(item,1))
(e.g. hash(item,0) should generally not be equal to hash(item,1))
- uses the murmur_hash3() routine to compute the actual hash.
- uses the murmur_hash3() routine to compute the actual hash.
- Note that the returned hash value will be different on big-endian and
little-endian systems since hash() doesn't attempt to perform any byte
swapping of the data contained in item. If you want to always obtain
the same hash then you need to byte swap the elements of item before
passing it to hash().
!*/
!*/
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------
...
...
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