Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
lagebj committed Nov 11, 2019
2 parents f082643 + c74be03 commit a08a03a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 22 deletions.
2 changes: 1 addition & 1 deletion Passphraser.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

@{
RootModule = 'Passphraser.psm1'
ModuleVersion = '1.0.6'
ModuleVersion = '1.0.7'
GUID = 'b40097d7-bc39-4f92-a85d-cc5e39be939a'
Author = 'Lage Berger Jensen'
CompanyName = ''
Expand Down
36 changes: 15 additions & 21 deletions classes/Passphrase.Class.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,9 @@
$this.IncludeUppercase = $true
}

$this.Words = $WordsArray
$WordsArray | ForEach-Object {
$this.Words.Add($_)
}

$PassphraseStrength = $this.GetStrength($true)
$this.Points = $PassphraseStrength[0]
Expand Down Expand Up @@ -235,28 +237,24 @@
$Score = $Score + 4
}

if ($String.Lenth -ge 8) {
$String.Substring(1,7).ToCharArray() | ForEach-Object {
if ($String.Length -ge 8) {
(($String.Substring(1, 7) -split '') -ne '') | ForEach-Object {
$Score = $Score + 2
}
} elseif ($String.Length -lt 8 -and $String.Length -gt 1) {
$String.Substring(1,($String.Length - 1)).ToCharArray() | ForEach-Object {
(($String.Substring(1, ($String.Length - 1)) -split '') -ne '') | ForEach-Object {
$Score = $Score + 2
}
}

if ($String.Lenth -ge 20) {
$String.Substring(8,19).ToCharArray() | ForEach-Object {
$Score = $Score + 1.5
}
} elseif ($String.Length -lt 20 -and $String.Length -gt 8) {
$String.Substring(8,($String.Length - 8)).ToCharArray() | ForEach-Object {
if ($String.Length -le 20 -and $String.Length -gt 8) {
(($String.Substring(8, ($String.Length - 8)) -split '') -ne '') | ForEach-Object {
$Score = $Score + 1.5
}
}

if ($String.Length -gt 20) {
$String.ToCharArray() | ForEach-Object {
(($String.Substring(20, ($String.Length - 20)) -split '') -ne '') | ForEach-Object {
$Score = $Score + 1
}
}
Expand Down Expand Up @@ -326,28 +324,24 @@
$Score = $Score + 4
}

if ($String.Lenth -ge 8) {
$String.Substring(1,7).ToCharArray() | ForEach-Object {
if ($String.Length -ge 8) {
(($String.Substring(1, 7) -split '') -ne '') | ForEach-Object {
$Score = $Score + 2
}
} elseif ($String.Length -lt 8 -and $String.Length -gt 1) {
$String.Substring(1,($String.Length - 1)).ToCharArray() | ForEach-Object {
(($String.Substring(1, ($String.Length - 1)) -split '') -ne '') | ForEach-Object {
$Score = $Score + 2
}
}

if ($String.Lenth -ge 20) {
$String.Substring(8,19).ToCharArray() | ForEach-Object {
$Score = $Score + 1.5
}
} elseif ($String.Length -lt 20 -and $String.Length -gt 8) {
$String.Substring(8,($String.Length - 8)).ToCharArray() | ForEach-Object {
if ($String.Length -le 20 -and $String.Length -gt 8) {
(($String.Substring(8, ($String.Length - 8)) -split '') -ne '') | ForEach-Object {
$Score = $Score + 1.5
}
}

if ($String.Length -gt 20) {
$String.ToCharArray() | ForEach-Object {
(($String.Substring(20, ($String.Length - 20)) -split '') -ne '') | ForEach-Object {
$Score = $Score + 1
}
}
Expand Down

0 comments on commit a08a03a

Please sign in to comment.