PluginProbe
Defender Security – Malware Scanner, Login Security & Firewall / 6.0.1
Defender Security – Malware Scanner, Login Security & Firewall v6.0.1
6.3.0 6.2.3 6.2.4 6.2.0 6.2.1 6.2.2 6.1.0 5.3.1 5.4.0 5.4.1 5.5.0 5.5.1 5.6.0 5.6.1 5.6.2 5.7.0 5.7.1 5.7.2 5.8.0 5.8.1 5.9.0 6.0.0 6.0.1 3.0.1 3.1.0 All 141 releases
defender-security / vendor / thecodingmachine / safe / generated / ssdeep.php

ssdeep.php in Defender Security – Malware Scanner, Login Security & Firewall 6.0.1, at vendor/thecodingmachine/safe/generated/ssdeep.php

71 lines 1.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Safe;
4
5 use Safe\Exceptions\SsdeepException;
6
7 /**
8 * Calculates the match score between signature1
9 * and signature2 using
10 * context-triggered piecewise hashing, and returns the match
11 * score.
12 *
13 * @param string $signature1 The first fuzzy hash signature string.
14 * @param string $signature2 The second fuzzy hash signature string.
15 * @return int Returns an integer from 0 to 100 on success, FALSE otherwise.
16 * @throws SsdeepException
17 *
18 */
19 function ssdeep_fuzzy_compare(string $signature1, string $signature2): int
20 {
21 error_clear_last();
22 $result = \ssdeep_fuzzy_compare($signature1, $signature2);
23 if ($result === false) {
24 throw SsdeepException::createFromPhpError();
25 }
26 return $result;
27 }
28
29
30 /**
31 * ssdeep_fuzzy_hash_filename calculates the hash
32 * of the file specified by file_name using
33 * context-triggered piecewise
34 * hashing, and returns that hash.
35 *
36 * @param string $file_name The filename of the file to hash.
37 * @return string Returns a string on success, FALSE otherwise.
38 * @throws SsdeepException
39 *
40 */
41 function ssdeep_fuzzy_hash_filename(string $file_name): string
42 {
43 error_clear_last();
44 $result = \ssdeep_fuzzy_hash_filename($file_name);
45 if ($result === false) {
46 throw SsdeepException::createFromPhpError();
47 }
48 return $result;
49 }
50
51
52 /**
53 * ssdeep_fuzzy_hash calculates the hash of
54 * to_hash using
55 * context-triggered piecewise hashing, and returns that hash.
56 *
57 * @param string $to_hash The input string.
58 * @return string Returns a string on success, FALSE otherwise.
59 * @throws SsdeepException
60 *
61 */
62 function ssdeep_fuzzy_hash(string $to_hash): string
63 {
64 error_clear_last();
65 $result = \ssdeep_fuzzy_hash($to_hash);
66 if ($result === false) {
67 throw SsdeepException::createFromPhpError();
68 }
69 return $result;
70 }
71