title: c# equivalent of nodejs code
body: <p>I need c# equivalent of the below nodejs code. I have some c# code, but the results are not the same.</p>
  
  <p>//working node code below</p>
  
  <pre><code>    Ice3x.prototype._signMessage = function (message) {
    var hmac = crypto.createHmac('sha512',new Buffer(this.secret, 'base64'));
    hmac.update(message);
    var signature = hmac.digest('base64');
    return signature;
  }
  </code></pre>
  
  <p>//c# code below</p>
  
  <pre><code>   public class HmacSignatureCalculator : ICalculteSignature
      {
          public string Signature(string secret, string value)
          {
              var secretBytes = Encoding.UTF8.GetBytes(secret);
              var valueBytes = Encoding.UTF8.GetBytes(value);
              string signature;
  
              using (var hmac = new HMACSHA512(secretBytes))
              {
                  var hash = hmac.ComputeHash(valueBytes);
                  signature = Convert.ToBase64String(hash);
              }
              return signature;
          }
      }
  </code></pre>