Fan.Sys.MemBuf.toDigest C# (CSharp) Method

toDigest() public method

public toDigest ( string algorithm ) : Buf
algorithm string
return Buf
        public override Buf toDigest(string algorithm)
        {
            string alg = algorithm;
              if (alg == "SHA-1") alg = "SHA1";  // to make .NET happy
              HashAlgorithm ha = HashAlgorithm.Create(alg);
              if (ha == null)
            throw ArgErr.make("Unknown digest algorthm: " + algorithm).val;
              return new MemBuf(ha.ComputeHash(m_buf, 0, m_size));
        }