From d27cddaaccc68eaa1b37b3a0694ba3e40a8fe049 Mon Sep 17 00:00:00 2001 From: hatstand0 Date: Fri, 26 Sep 2014 00:09:14 +1000 Subject: [PATCH] Add file hash to API The API currently lacks the Base64 encoded file hash 4chan's API provides, which assists in file de-duplication by archive software. --- inc/api.php | 1 + 1 file changed, 1 insertion(+) diff --git a/inc/api.php b/inc/api.php index d7b28ee9..3769a9c9 100644 --- a/inc/api.php +++ b/inc/api.php @@ -113,6 +113,7 @@ class Api { $apiPost['ext'] = substr($file->file, $dotPos); $dotPos = strrpos($file->file, '.'); $apiPost['tim'] = substr($file->file, 0, $dotPos); + $apiPost['md5'] = base64_encode(md5_file($file->file_path, true)); } return $apiPost;