password generator
 

News:

29 December 2022 - PtokaX 0.5.3.0 (20th anniversary edition) released...
11 April 2017 - PtokaX 0.5.2.2 released...
8 April 2015 Anti child and anti pedo pr0n scripts are not allowed anymore on this board!
28 September 2015 - PtokaX 0.5.2.1 for Windows 10 IoT released...
3 September 2015 - PtokaX 0.5.2.1 released...
16 August 2015 - PtokaX 0.5.2.0 released...
1 August 2015 - Crowdfunding for ADC protocol support in PtokaX ended. Clearly nobody want ADC support...
30 June 2015 - PtokaX 0.5.1.0 released...
30 April 2015 Crowdfunding for ADC protocol support in PtokaX
26 April 2015 New support hub!
20 February 2015 - PtokaX 0.5.0.3 released...
13 April 2014 - PtokaX 0.5.0.2 released...
23 March 2014 - PtokaX testing version 0.5.0.1 build 454 is available.
04 March 2014 - PtokaX.org sites were temporary down because of DDOS attacks and issues with hosting service provider.

Main Menu

password generator

Started by Mr.T, 21 August, 2007, 16:24:35

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Mr.T

is it possible to make a script that makes password for users i have thinking to change password for all users every year
for password i wood like to have it like this 8 characters then the year like this    dhe45srt-2007  hope you now what i mean

:)

zero-cool

#1
Here's random code
Generate = function(n)
	local t,i,r,e1,e2,_
	local s = ""
	t = { "48-57","65-90","97-122"}
	for i=1,n do
		r = math.random(1,table.getn(t))
		_,_,e1,e2 = string.find(t[r],"(%d+)%-(%d+)")
		s = s..string.char(math.random(e1,e2))
	end
	return(s)
end

Use Generate(x), where x is the number of characters you want.

Best regards,

bastya_elvtars

Why not put ASCII ranges to an array inside the "big" array and unpack the "little" array after randomly choosing it from the "big" one?
math.random(unpack(arr))
Everything could have been anything else and it would have just as much meaning.

zero-cool

local r = math.random(#t)

What does "#" means?

bastya_elvtars

#t is the number of elements in array t. It used to be table.getn(t)
Everything could have been anything else and it would have just as much meaning.

zero-cool

Quote from: bastya_elvtars on 22 August, 2007, 02:54:23
#t is the number of elements in array t. It used to be table.getn(t)
Thanks  ;) ;)

bastya_elvtars

table.maxn gets the highest numerical index from "mixed" tables(e. g. {["a"]=b, "c","d"}) too. Of course this is achieved via iterating through the table, so it's really slow and should only be used when really necessary (that is, for tables like the one I posted above).
Everything could have been anything else and it would have just as much meaning.

Mr.T

what i mean is if it's possible to make a script that gennerate password ex.
if you reg a user you go to this script an it makes a password for the user whit rigtclick that you can use to reg the user :)

Mr.T

can't find it  :)
can somebody post this script her cant find it Auto-Pass 1.0 LUA 5.0/5.1
:)


Mr.T


SMF spam blocked by CleanTalk