private string GetSignature(long nonce) { string message = nonce + Method.Method.ToUpper() + Path + Payload; byte[] encodedMessage = Encoding.UTF8.GetBytes(message); using (var hmac = configuration.GenerateHmac()) { byte[] signature = hmac.ComputeHash(encodedMessage); StringBuilder sb = new StringBuilder(signature.Length * 2); foreach (byte b in signature) { sb.AppendFormat("{0:x2}", b); } return(sb.ToString()); } }