From afc3e0f15e6c4e69d17fd5a84253a436a4fba4fc Mon Sep 17 00:00:00 2001 From: Peter Lejeck Date: Thu, 31 Oct 2013 05:01:18 -0700 Subject: Move upload.php into static dir, and do hardcore refactoring --- static/classes/UploadedFile.class.php | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 static/classes/UploadedFile.class.php (limited to 'static/classes') diff --git a/static/classes/UploadedFile.class.php b/static/classes/UploadedFile.class.php new file mode 100644 index 0000000..5b7ba9b --- /dev/null +++ b/static/classes/UploadedFile.class.php @@ -0,0 +1,32 @@ +sha1) $this->sha1 = sha1_file($this->tempfile); + + return $this->sha1; + } + /** + * Generates the CRC32 or returns the cached CRC32 hash for the file. + */ + public function get_crc32 () { + if (! $this->crc32) $this->crc32 = hash_file('crc32b', $this->tempfile); + + return $this->crc32; + } +} +?> -- cgit v1.2.3