title: HMAC with custom HashAlgorithm
body: <p>There are built in HMAC's (HMACSHA1 - HMACSHA512 ...).
  But is it possible to create a HMAC with a custom HashAlgorithm class?</p>
  
  <p>I tried <code>HMAC.Create("location")</code> but that just threw a <code>NullReferenceException</code></p>
  
  <p>Could there be a Constructor like <code>new HMAC(HashAlgorithm)</code>?</p>
  
  <p>This is the Code for the HashAlgorithm (Fnv1 Hash):</p>
  
  <pre><code>public class Fnv1_32 : HashAlgorithm
  {
      private const uint prime = 0x01000193;
      private const uint offsetbasis = 0x811C9DC5;
      private uint _Hash;
  
      public Fnv1_32()
      {
          this.Initialize();
          this.HashSizeValue = 32;
      }
  
      public override void Initialize()
      {
          this._Hash = offsetbasis;
      }
  
      protected override void HashCore(byte[] array, int ibStart, int cbSize)
      {
          for (var i = ibStart; i &lt; cbSize; i++)
          {
              this._Hash *= prime;
              this._Hash ^= array[i];
          }
      }
  
      protected override byte[] HashFinal()
      {
          return BitConverter.GetBytes(this._Hash);
      }
  }
  </code></pre>