Skip to content

Commit deada2b

Browse files
CopilotBillWagner
andcommitted
Update from SHA-1 to SHA-256 for improved security
Co-authored-by: BillWagner <[email protected]>
1 parent 49b885f commit deada2b

File tree

1 file changed

+2
-2
lines changed
  • samples/snippets/visualbasic/VS_Snippets_VBCSharp/VbVbalrStrings/VB

1 file changed

+2
-2
lines changed

samples/snippets/visualbasic/VS_Snippets_VBCSharp/VbVbalrStrings/VB/Class3.vb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,11 @@ Class Class1f51e40a2f8843e2a83e28a0b5c0d6fd
8282
ByVal key As String,
8383
ByVal length As Integer) As Byte()
8484

85-
Using sha1 As SHA1 = SHA1.Create()
85+
Using sha256 As SHA256 = SHA256.Create()
8686
' Hash the key.
8787
Dim keyBytes() As Byte =
8888
System.Text.Encoding.Unicode.GetBytes(key)
89-
Dim hash() As Byte = sha1.ComputeHash(keyBytes)
89+
Dim hash() As Byte = sha256.ComputeHash(keyBytes)
9090

9191
' Truncate or pad the hash.
9292
ReDim Preserve hash(length - 1)

0 commit comments

Comments
 (0)