I'm not sure if this description is only for purposes of simplicity, but every hash function has collisions. So, a hash function will never be able to calculate a unique code for a piece of data.