FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
phash/example.php at master · hallsten/phash · GitHub
hallsten
/
phash
Public
forked from
xwiz/phash
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
phash
/
example.php
Copy path
More file actions
More file actions
Latest commit
History
History
History
23 lines (18 loc) · 680 Bytes
Breadcrumbs
phash
/
example.php
Copy path
File metadata and controls
23 lines (18 loc) · 680 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<?php
include
(
'
phash.php
'
);
#sample implementation
$
phasher
=
new
Phash
;
$
phash2
=
$
phasher
->
getHash
(
'
phash2.jpg
'
,
false
);
//this will echo hash in hex, then binary
echo
$
phasher
->
hashAsString
(
$
phash2
,
false
).
PHP_EOL
;
echo
$
phasher
->
hashAsString
(
$
phash2
).
PHP_EOL
;
$
phash3
=
$
phasher
->
getHash
(
'
phash3.jpg
'
,
false
);
//this will echo hash in hex, then binary
echo
$
phasher
->
hashAsString
(
$
phash3
,
false
).
PHP_EOL
;
echo
$
phasher
->
hashAsString
(
$
phash3
).
PHP_EOL
;
//using BIT COUNT METHOD FOR SIMILARITY
echo
$
phasher
->
getSimilarity
(
$
phash2
,
$
phash3
,
'
BITS
'
);
echo
PHP_EOL
;
//using HAMMING METHOD (DEFAULT) FOR SIMILARITY
echo
$
phasher
->
getSimilarity
(
$
phash2
,
$
phash3
);
echo
PHP_EOL
;
Back
|
FazBrowse Home
|
New Git URL