06-30-2009, 06:38 PM
[eluser]Pinkiee[/eluser]
I have just started looking into CI, and I was writing a prototype and needed something similar to this.
Sorry, not be be harsh, but I can't in good conscious let people who don't know any better use this with out knowing how much work it needs. I only had a look at one of the functions. (Password strength)
Couple of things you need to look into bud,
ctype (in general)
ctype_lower
ctype_upper
ctype_digit
ctype_punct
Creating an array for "lower case" etc isn't needed in this situation given the scope of the helper.
If your not doing anything to a variable then there is no reason to make an assignment
$i +=0; // is useless
You don't need to loop through the string for every single check your doing, you could loop through it once and do a switch statement and just increment the counters.
This is a bit of personal choice, but if you are looping through a string looking for something and you find it, there is no reason to keep looping.
Sorry this is all off memory as I was looking at it last night.
You can do one loop.
Really good concept though, and I think it would be quite a useful helper, when I get to a computer with a winrar on it, I will post a little clean up of the code so you can see the changes I would suggest.
I have just started looking into CI, and I was writing a prototype and needed something similar to this.
Sorry, not be be harsh, but I can't in good conscious let people who don't know any better use this with out knowing how much work it needs. I only had a look at one of the functions. (Password strength)
Couple of things you need to look into bud,
ctype (in general)
ctype_lower
ctype_upper
ctype_digit
ctype_punct
Creating an array for "lower case" etc isn't needed in this situation given the scope of the helper.
If your not doing anything to a variable then there is no reason to make an assignment
$i +=0; // is useless
You don't need to loop through the string for every single check your doing, you could loop through it once and do a switch statement and just increment the counters.
This is a bit of personal choice, but if you are looping through a string looking for something and you find it, there is no reason to keep looping.
Sorry this is all off memory as I was looking at it last night.
You can do one loop.
Really good concept though, and I think it would be quite a useful helper, when I get to a computer with a winrar on it, I will post a little clean up of the code so you can see the changes I would suggest.