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
d01eee95
Commit
d01eee95
authored
Nov 28, 2012
by
Davis King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added murmur_hash3_3()
parent
49f2d6f9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
63 additions
and
0 deletions
+63
-0
murmur_hash3.h
dlib/general_hash/murmur_hash3.h
+47
-0
murmur_hash3_abstract.h
dlib/general_hash/murmur_hash3_abstract.h
+16
-0
No files found.
dlib/general_hash/murmur_hash3.h
View file @
d01eee95
...
@@ -255,6 +255,53 @@ namespace dlib
...
@@ -255,6 +255,53 @@ namespace dlib
return
h1
;
return
h1
;
}
}
// ----------------------------------------------------------------------------------------
inline
uint32
murmur_hash3_3
(
const
uint32
v1
,
const
uint32
v2
,
const
uint32
v3
)
{
uint32
h1
=
v3
;
uint32
c1
=
0xcc9e2d51
;
uint32
c2
=
0x1b873593
;
//----------
// body
uint32
k1
=
v1
;
k1
*=
c1
;
k1
=
DLIB_ROTL32
(
k1
,
15
);
k1
*=
c2
;
h1
^=
k1
;
h1
=
DLIB_ROTL32
(
h1
,
13
);
h1
=
h1
*
5
+
0xe6546b64
;
k1
=
v2
;
k1
*=
c1
;
k1
=
DLIB_ROTL32
(
k1
,
15
);
k1
*=
c2
;
h1
^=
k1
;
h1
=
DLIB_ROTL32
(
h1
,
13
);
h1
=
h1
*
5
+
0xe6546b64
;
//----------
// finalization
h1
^=
8
;
// =^ by length in bytes
h1
=
murmur_fmix
(
h1
);
return
h1
;
}
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------
inline
std
::
pair
<
uint64
,
uint64
>
murmur_hash3_128bit
(
inline
std
::
pair
<
uint64
,
uint64
>
murmur_hash3_128bit
(
...
...
dlib/general_hash/murmur_hash3_abstract.h
View file @
d01eee95
...
@@ -44,6 +44,22 @@ namespace dlib
...
@@ -44,6 +44,22 @@ namespace dlib
See: http://code.google.com/p/smhasher/
See: http://code.google.com/p/smhasher/
!*/
!*/
// ----------------------------------------------------------------------------------------
inline
uint32
murmur_hash3_3
(
const
uint32
v1
,
const
uint32
v2
,
const
uint32
v3
);
/*!
ensures
- returns a 32bit hash of the three integers given to this function.
- This function is machine architecture agnostic and should always give the same
hash value when presented with the same inputs.
- This hashing algorithm is Austin Appleby's excellent MurmurHash3_x86_32.
See: http://code.google.com/p/smhasher/
!*/
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------
std
::
pair
<
uint64
,
uint64
>
murmur_hash3_128bit
(
std
::
pair
<
uint64
,
uint64
>
murmur_hash3_128bit
(
...
...
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