Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
D
dlib
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
钟尚武
dlib
Commits
3785d320
Commit
3785d320
authored
May 28, 2011
by
Davis King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added comments regarding endianness and hashing.
parent
a68c27be
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
0 deletions
+37
-0
hash_abstract.h
dlib/general_hash/hash_abstract.h
+29
-0
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