Smanji broj okvirova / koristi adler hash

This commit is contained in:
Senad Uka
2020-08-30 05:57:19 +02:00
parent aa1bdcb36c
commit 85d67d058b
3 changed files with 8 additions and 10 deletions

View File

@@ -1,15 +1,13 @@
<?php
function hashedName() {
$now = time();
$somenumber = rand();
return sha1("ojhaa $now $somenumber ojhaaa");
function hashedName($fileName) {
return mhash(MHASH_ADLER32, $fileName);
}
$target_dir = __DIR__ . "/../slike/";
$target_file = $target_dir . basename($_FILES["fileToUpload"]["name"]);
$imageFileType = strtolower(pathinfo($target_file,PATHINFO_EXTENSION));
$hashed_name = hashedName();
$hashed_name = hashedName($target_file);
$target_file = $target_dir . $hashed_name . ".$imageFileType";
$uploadOk = 1;