Jump to content
zapptech

Generare user/pass .php

Recommended Posts

Posted

Salut, am nevoie de unde script care sa  imi genereze cate un user si o parola de la 1 la 600.

Exemplu: Camera1 -fsafsa!@#fasfFASFsa

              Camera2 -fsafdsadsafasfFASFsa

              Camera3 -fsafsa111#fasfFASFsa

Am gasit ceva asemanator si pe net insa nu mi-au fost de folos. Cineva priceput la php? help please :).

Posted

http://stackoverflow.com/questions/4356289/php-random-string-generator

function generateRandomString($length = 10) {
    return substr(str_shuffle("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"), 0, $length);
}

// Echo the random string.
// Optionally, you can give it a desired string length up to 62 characters.
echo generateRandomString();

Si mai poti face pentru parola cu celelalte charactere: ".^%##$@*(". Etc.

Posted (edited)

poftim in python 2.7

import string
import random
def cameras(size=6, chars=string.ascii_uppercase + string.digits + string.ascii_lowercase):
        return ''.join(random.choice(chars) for c in range(size))
def cameras2(size=6, chars=string.ascii_uppercase + string.digits + string.ascii_lowercase):
        return ''.join(random.choice(chars) for c in range(size))
camera = "Camera"
nume = 0
Tigan = True
f = open("test.txt", "w")
l = 600
for puka in range(l):
	nume = nume + 1
        kappa = cameras()
        kappa1 = cameras2()
	f.write(camera + str(nume) + " -" + kappa + "@" + kappa1 +"\r\n")

 

Edited by Cripterul

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...