Dear friends, I read in a book that every time you have to store data that you are certain it will be a certain amount of chars, use CHAR data type instead of VARCHAR since it is a lot faster. So I was wondering, since I will be using a hashing algoritam to hash all my password I will be storing in a DB, and since there will ALWAYS be 40 chars why not use the CHAR data type? The only thing that is stopping me from doing it is that I see a lot of tutorials where they show people to store the password only with the VARCHAR data type, so I was wondering, what is your opinion on that matter? Thank you! Best Regards Stefany
If you know that the size will always be EXACTLY the same then you can use CHAR, it will be faster...I guess because not everyone will hash the passwords then yes they will have to use varchar, but in your case don't worry about it and just use CHAR(40)