I have a video website. Whenever a file gets uploaded it needs to be compared to all other existing files(videos) to ensure it's not a duplicate.
Considering that with each upload the number of files to be compared gets bigger I'm looking for a solution that will be relatively fast.
Ideally this will be executed using shell_exec
from php so it should return some kinda of output if the file already exists(a simple 0 or 1 will do).
I do know about cmp
and diff
but i fear that with the number of files existing this will be rather slow.
Are there any other solutions I should look into?