File tree 1 file changed +12
-12
lines changed
1 file changed +12
-12
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ function Hash($textToHash)
4
4
PowerShell function to generate/retrieve unique local administrator passwords.
5
5
. DESCRIPTION
6
6
Takes an MD5 hash of a (optional) unique string, a hardcoded string, and the hostname in which
7
- the function is run on.
7
+ the function is run on.
8
8
. NOTES
9
9
Author : jakx_
10
10
. EXAMPLE
@@ -14,23 +14,23 @@ function Hash($textToHash)
14
14
$hostname = hostname
15
15
16
16
$s = " foobar"
17
-
17
+
18
18
$new = " $hostname " + " $s " + " $texttoHash "
19
-
20
- $hashme = new-object System.Security.Cryptography.MD5CryptoServiceProvider
21
19
22
- $tohash = [System.Text.Encoding ]::UTF8.GetBytes($new )
20
+ $hashme = new-object System.Security.Cryptography.MD5CryptoServiceProvider
21
+
22
+ $tohash = [System.Text.Encoding ]::UTF8.GetBytes($new )
23
23
24
- $ByteArray = $hashme.ComputeHash ($tohash )
24
+ $ByteArray = $hashme.ComputeHash ($tohash )
25
25
26
- foreach ($byte in $ByteArray )
26
+ foreach ($byte in $ByteArray )
27
27
28
- {
28
+ {
29
29
30
- $pass += $byte.ToString ()
30
+ $pass += $byte.ToString ()
31
31
32
- }
32
+ }
33
33
34
- return $pass ;
34
+ return $pass ;
35
35
36
- }
36
+ }
You can’t perform that action at this time.
0 commit comments