Theoretically does hashing a unique value yield a unique value?
Let's say I have a DB table with 2 columns: id and code. id is an auto-incrementing int and code is a varchar. If I do ...
$code = sha1($id);
... and then store $code into the same row as $id. Will my code column be unique as well?
What about if I append the current time? eg:
$code = sha1($id . time());
Thanks.