I want to make unique code with sha1 with unique salt (definitely unique because i use id from table). I need unique code with 7 character but i can't use id from my table because it's more than 7 character. So i think it's better to use sha1 and take first 7 character of hashed text as my unique code. Does the length of the text to be hashed affect the probability of a collision?
for example :
textA = "myId:12345678"
textB = "myId:12345678, myId2:87654321"
Is it better to use long short text (e.g textA) or text (e.g textB)? Or does the text length have no effect?