OpenOffice Calc Macros Basic Password Generator
Function PW_gen(ByVal length AS Integer, ByVal strength As Integer) Dim vowels As string Dim consonants As string Dim password As string Dim alt As Integer Dim i As Integer vowels = "eyuioaj" consonants = "qzcxswrtnvfdghkpml" If (strength >= 1) Then consonants = consonants + "QZCXSWRTNVFDGHKPML" End If If (strength >= 2) Then vowels = vowels + "EYUIOAJ" EndIf If (strength >= 4) Then consonants = consonants + "1837254690" End If If (strength >= 8) Then consonants = consonants + "@#$%" End If password = "" Randomize() alt = Int((2 * Rnd) + 1) For i = 0 To length-1 If (alt = 2) Then password = password + Mid(consonants, Int((Len(consonants) * Rnd) + 1), 1) alt = 1 password = password + Mid(vowels, Int((Len(vowels) * Rnd) + 1), 1) alt = 2 Next i PW_gen = password End Function
нажмите F2
PW_gen(16;8)
Где:
16 x 2 - 1 = длина
8 > сила пароля