|
|
|
SSCrazy
      
Group: General Forum Members
Last Login: Monday, May 06, 2013 1:26 PM
Points: 2,359,
Visits: 3,292
|
|
|
|
|
|
Right there with Babe
      
Group: General Forum Members
Last Login: Friday, May 17, 2013 9:18 AM
Points: 772,
Visits: 1,825
|
|
Very good! One problem though. Your code to limit the password length does not work if I pass negative numbers. When the specs are negative then they can't be more negative ten the number of items in the list. You can't call for more than 26 non-duplicated upper case letters as there are only 26 of them.
ATB
Charles Kincaid
|
|
|
|
|
SSC Journeyman
      
Group: General Forum Members
Last Login: Thursday, November 08, 2012 1:57 PM
Points: 96,
Visits: 60
|
|
Hi, I always think that when ever i find some time spare than i will write this one.But u did and did in a nice way
|
|
|
|
|
SSCertifiable
       
Group: General Forum Members
Last Login: Today @ 2:17 AM
Points: 6,862,
Visits: 8,049
|
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Thursday, November 19, 2009 11:49 AM
Points: 3,
Visits: 3
|
|
| Well, its a nice solution and working prefect.
|
|
|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Wednesday, January 09, 2013 3:53 PM
Points: 127,
Visits: 85
|
|
| A thought for generating passwords non-randomly: use your birthday in the Jewish (or Muslim or Persian or whatever) calendar. Therefore, if you forget it for whatever reason, you can regenerate it from a web site.
|
|
|
|
|
SSC Eights!
      
Group: General Forum Members
Last Login: Tuesday, August 10, 2010 4:54 AM
Points: 815,
Visits: 32
|
|
This is a great idea, I am going to use it in my application. I have re-written it as a function though (for consistency with standards of my system) by creating a view for the NEWID() function: CREATE VIEW v_NewID AS SELECT NEWID() AS 'New_ID' and modifying the code to use the view rather than NEWID() eg: -- Get the Number Items SET @i = ABS(@NumberItems) WHILE @i > 0 AND LEN(@Numbers) > 0 SELECT @v = ABS(CAST(CAST(New_ID AS BINARY(16)) AS BIGINT)) % LEN(@Numbers) + 1 , @c = SUBSTRING(@Numbers, @v, 1) , @Numbers = CASE WHEN @NumberItems < 0 THEN STUFF(@Numbers, @v, 1, '') ELSE @Numbers END , @Temp = @Temp + @c , @i = @i - 1 FROM v_NewID David
If it ain't broke, don't fix it...
|
|
|
|
|
SSC Rookie
      
Group: General Forum Members
Last Login: Thursday, March 20, 2008 2:08 PM
Points: 48,
Visits: 3
|
|
Nice job, I’ll use it for sure. I was using, since always, Left 4 of a new guid + Left 4 of a new guid (uppercase) Kind of…  Thanks
Best Regards,
David, MCAD.NET
|
|
|
|
|
SSCrazy
      
Group: General Forum Members
Last Login: Today @ 2:22 PM
Points: 2,944,
Visits: 10,508
|
|
This link below has my own procedure for generating a somewhat mnemonic password, as well as several others for generating random or semi-random passwords: http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=78859 It is an interesting problem, because of the conflicting requirements of security where long, random passwords are better, and the ability of a human to read, remember, and type the password. A password like B4zI1=5UhW4K6KM'3 is probably almost impossible to crack, but how many people can remember it and type it correctly? My mnemonic password procedure is an attempt at a compromise solution to generate passwords that are both secure and something that a human can remember and use. It could be done better, but it was the best solution I could think of at the time to meet my requirements.
|
|
|
|
|
SSCrazy
      
Group: General Forum Members
Last Login: Monday, May 06, 2013 1:26 PM
Points: 2,359,
Visits: 3,292
|
|
It doesn't matter. When you want non-duplicated characters from a group, the while loop exits when there are no more characters to choose from. Even if you set 50 non-duplicated characters, the while loop exits after 26.
N 56°04'39.16" E 12°55'05.25"
|
|
|
|