Novice2006 Posted July 16, 2009 Report Share Posted July 16, 2009 Hi all I understand this is sort of a silly to some even a stupid question I was wondering how would you do a letter by letter comparison. If you were making a password program. Thank you. Quote Link to comment
crelf Posted July 16, 2009 Report Share Posted July 16, 2009 I understand this is sort of a silly to some even a stupid question I was wondering how would you do a letter by letter comparison. If you were making a password program. Like you're checking if the password input by the user equals a constant in your code? You can use the "add" primative - it's polymorphic (which means it can adapt to different datatypes, including strings). Quote Link to comment
Christian_L Posted July 16, 2009 Report Share Posted July 16, 2009 Hi all I understand this is sort of a silly to some even a stupid question I was wondering how would you do a letter by letter comparison. If you were making a password program. Thank you. Use String Length to determine the number of letters in each password. Then use String Subset inside of a For Loop to extract each letter from each password. Then use Equal? to compare them. You can use the To Lower Case to make your comparison case independent, but you normally don't want that with passwords. Quote Link to comment
Aristos Queue Posted July 16, 2009 Report Share Posted July 16, 2009 Use the Type Cast primitive to cast your strings to an array of uInt8. Then you can compare each element. 1 Quote Link to comment
Ton Plomp Posted July 19, 2009 Report Share Posted July 19, 2009 From a security point, it is very bad to compare the actual passwords. Take an MD5 checksum of the (valid) password and compare this with the MD5 checksum of the entered password. By storing the checksum you have an authentication method that does not store the actual password. This is for instance done at the CR Class Object. What is the reason to compare the passwords letter by letter? Ton Quote Link to comment
Novice2006 Posted July 20, 2009 Author Report Share Posted July 20, 2009 The reason for comparing the password letter by letter is when someone is setting the password you confirm to make sure they didn't mistype the first time. SO i thought i was done letter by letter. Quote Link to comment
JustinThomas Posted July 21, 2009 Report Share Posted July 21, 2009 Add a Value change event for your string control. In this event compare the control value with the stored constant using the equal to operator. You would also be required to right click on the string control and select 'Update while typing'. This ensures that the value change event would fire every time you make a change in the string control Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.