﻿<?xml version="1.0" encoding="utf-8"?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
  <CodeSnippet Format="1.0.0">
    <Header>
      <Title>Compute the Hash Code of a Password</Title>
      <Author>Microsoft Corporation</Author>
      <Description>Computes the SHA1 hash code of a password.</Description>
      <Shortcut>secHashPass</Shortcut>
    </Header>
    <Snippet>
      <References>
        <Reference>
          <Assembly>System.Security.dll</Assembly>
        </Reference>
      </References>
      <Imports>
        <Import>
          <Namespace>Microsoft.VisualBasic</Namespace>
        </Import>
        <Import>
          <Namespace>System.Text</Namespace>
        </Import>
        <Import>
          <Namespace>System.Security.Cryptography</Namespace>
        </Import>
      </Imports>
      <Declarations>
        <Literal>
          <ID>password</ID>
          <Type>String</Type>
          <ToolTip>The String variable holding the password to be hashed.</ToolTip>
          <Default>"passwordString"</Default>
        </Literal>
      </Declarations>
      <Code Language="VB" Kind="method body"><![CDATA[        Dim sha1CryptoService As New SHA1CryptoServiceProvider()
        Dim byteValue = Encoding.UTF8.GetBytes($password$)
        Dim hashValue = sha1CryptoService.ComputeHash(byteValue)]]></Code>
    </Snippet>
  </CodeSnippet>
</CodeSnippets>