Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,11 @@ protected void Method()
// <Snippet1>
byte[] data = new byte[DATA_SIZE];
byte[] result;
SHA384 shaM = new SHA384Managed();
result = shaM.ComputeHash(data);

using (SHA384 sha384 = SHA384.Create())
{
result = sha384.ComputeHash(data);
}
// </Snippet1>
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@ protected void Method()
byte[] data = new byte[DATA_SIZE];
byte[] result;

SHA384 shaM = new SHA384Managed();
result = shaM.ComputeHash(data);
using (SHA384 shaM = new SHA384Managed())
{
result = shaM.ComputeHash(data);
}
// </Snippet1>
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,11 @@ protected void Method()
// <Snippet1>
byte[] data = new byte[DATA_SIZE];
byte[] result;
SHA512 shaM = new SHA512Managed();
result = shaM.ComputeHash(data);

using (SHA512 sha512 = SHA512.Create())
{
result = sha512.ComputeHash(data);
}
// </Snippet1>
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@ protected void Method()
byte[] data = new byte[DATA_SIZE];
byte[] result;

SHA512 shaM = new SHA512Managed();
result = shaM.ComputeHash(data);
using (SHA512 shaM = new SHA512Managed())
{
result = shaM.ComputeHash(data);
}
// </Snippet1>
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,17 @@
Imports System.ComponentModel
Imports System.Security.Cryptography

Public Class Sample
Protected DATA_SIZE As Integer = 1024
Protected Sub Method()
Public Module Sample
Private DATA_SIZE As Integer = 1024

Public Sub Main()
' <Snippet1>
Dim data(DATA_SIZE) As Byte
Dim result() As Byte
Dim shaM As New SHA384Managed()
result = shaM.ComputeHash(data)
Dim data(DATA_SIZE) As Byte
Dim result() As Byte

Using sha384 As SHA384 = SHA384.Create()
result = sha384.ComputeHash(data)
End Using
' </Snippet1>
End Sub
End Class
End Module
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<RootNamespace>vb</RootNamespace>
<TargetFramework>net6.0</TargetFramework>
</PropertyGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
Imports System.ComponentModel
Imports System.Security.Cryptography

Public Class Sample
Protected DATA_SIZE As Integer = 1024
Protected Sub Method()
Public Module Sample
Private DATA_SIZE As Integer = 1024

Public Sub Main()
' <Snippet1>
Dim data(DATA_SIZE) As Byte
Dim result() As Byte
Dim shaM As New SHA384Managed()
result = shaM.ComputeHash(data)
Dim data(DATA_SIZE) As Byte
Dim result() As Byte
Using shaM As New SHA384Managed()
result = shaM.ComputeHash(data)
End Using
' </Snippet1>
End Sub
End Class
End Module
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<RootNamespace>vb</RootNamespace>
<TargetFramework>net6.0</TargetFramework>
</PropertyGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,17 @@
Imports System.ComponentModel
Imports System.Security.Cryptography

Public Class Sample
Protected DATA_SIZE As Integer = 1024
Protected Sub Method()
Public Module Sample
Private DATA_SIZE As Integer = 1024

Public Sub Main()
' <Snippet1>
Dim data(DATA_SIZE) As Byte
Dim result() As Byte
Dim shaM As New SHA512Managed()
result = shaM.ComputeHash(data)
Dim data(DATA_SIZE) As Byte
Dim result() As Byte

Using sha512 As SHA512 = SHA512.Create()
result = sha512.ComputeHash(data)
End Using
' </Snippet1>
End Sub
End Class
End Module
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<RootNamespace>vb</RootNamespace>
<TargetFramework>net6.0</TargetFramework>
</PropertyGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,17 @@
Imports System.ComponentModel
Imports System.Security.Cryptography

Public Class Sample
Protected DATA_SIZE As Integer = 1024
Protected Sub Method()
Public Module Sample
Private DATA_SIZE As Integer = 1024

Public Sub Main()
' <Snippet1>
Dim data(DATA_SIZE) As Byte
Dim result() As Byte

Dim shaM As New SHA512Managed()
result = shaM.ComputeHash(data)
Dim data(DATA_SIZE) As Byte
Dim result() As Byte

Using shaM As New SHA512Managed()
result = shaM.ComputeHash(data)
End Using
' </Snippet1>
End Sub
End Class
End Module
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<RootNamespace>vb</RootNamespace>
<TargetFramework>net6.0</TargetFramework>
</PropertyGroup>

</Project>