# Signature Value Calculation

Creating method of Signature value：

Step 1、Combination string\
String formation:

```
    {TimeStamp}{Exclusive encryption Salt}
```

Example：\
TimeStamp:1490714051 (Tue, 28 Mar 2017 15:14:11 GMT)\
Exclusive encryption Salt provided by e-Invoice: ABCDEFGHIJKLMNOPQRSTUVWXYZ

```
    1490714051ABCDEFGHIJKLMNOPQRSTUVWXYZ
```

Step 2、Use the SHA256 hash with the string

Step 3、Byte\[] to Hex String

Result of Example：\
42AFE0433C4EB08B9266E3B50C72A9D11D4946DC79B7AFD4B73AE9175185644B

Example for C#

```
// Get the signature verification value
public string GetInvoiceSignature(string TimeStamp, string Data, string HashSalt)
{
      string _hashString = string.Format("{0}{1}", TimeStamp, HashSalt);
      return SHA256Encrypt(_hashString);
}

// Using SHA256 encryption
public string SHA256Encrypt(string NonEncryptString)
{
    SHA256 sha256 = new SHA256CryptoServiceProvider();//Building SHA256
    byte[] source = Encoding.ASCII.GetBytes(NonEncryptString);//String to Byte[]
    byte[] crypto = sha256.ComputeHash(source);//Encryption with SHA256
    string result = BitConverter.ToString(crypto).Replace("-", string.Empty);//Change the encrypted string from Byte [] to string
    return result;//Output the result
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://slproject.gitbook.io/sl-einv-project/en/signature-value-calculation.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
