convert binary to number of characters

In my sql table, I have a password field that is varbinary(255). How many characters is this? i want to set the maxlength on my textbox to accomodate as many characters as my db will allow. Please help thank
TrialUserAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

käµfm³d 👽Commented:
I believe it's going to depend on how you're encoding the characters.
0
Gustav BrockCIOCommented:
It could be 255 for pure ASCII, but for a password it most likely holds Unicode encoded strings. As each character then takes two bytes, the field allows for 127 characters. The last byte is probably never used.

/gustav
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Julian HansenCommented:
Quote from here (https://dev.mysql.com/doc/refman/5.0/en/binary-varbinary.html)
The BINARY and VARBINARY types are similar to CHAR and VARCHAR, except that they contain binary strings rather than nonbinary strings. That is, they contain byte strings rather than character strings. This means that they have no character set, and sorting and comparison are based on the numeric values of the bytes in the values.
The data is made of bytes so the max length would be 255
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP.NET

From novice to tech pro — start learning today.