# Error Hashing in Latest SDK 3.3.5

**URL:** <https://zatca1.discourse.group/t/error-hashing-in-latest-sdk-3-3-5/3185>\
**Category:** General\
**Created:** [September 22, 2024, 8:22am UTC](https://zatca1.discourse.group/t/error-hashing-in-latest-sdk-3-3-5/3185 "2024-09-22T08:22:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Abdulraouf](https://avatars.discourse-cdn.com/v4/letter/a/e9c0ed/32.png) [@Abdulraouf](https://zatca1.discourse.group/u/Abdulraouf)\
**Post date:** [September 22, 2024, 8:22am UTC](https://zatca1.discourse.group/t/error-hashing-in-latest-sdk-3-3-5/3185/1 "2024-09-22T08:22:22Z")

</div>

hash value not equal when using CLI command or Zatca.EInvoice.SDK.EInvoiceHashGenerator class

this invoice

\<?xml version="1.0" encoding="utf-8"?\> reporting:1.0 240100001 601d7f71-8eea-4ba1-873f-e349df090f2d 2024-09-19 12:47:12 388 SAR SAR ICV 24001000000001 PIH NWZlY2ViNjZmZmM4NmYzOGQ5NTI3ODZjNmQ2OTZjNzljMmRiYzIzOWRkNGU5MWI0NjcyOWQ3M2EyN2ZiNTdlOQ== urn:oasis:names:specification:ubl:signature:Invoice urn:oasis:names:specification:ubl:dsig:enveloped:xades 4031065498 Prince Sultan 2322 Al-Murabba Riyadh 23333 1234 SA 311280595100003 VAT شركة قصور الحجر شركة شخص واحد Salah Al-Din 1111 Al-Murooj Riyadh 12222 1234 SA 399999999800003 VAT Fatoora Samples LTD 30 CANCELLATION\_OR\_TERMINATION false discount 1 S 15 VAT 0.15 0.15 1 0.15 S 15 VAT 2 1 1.15 1 0 1.15 1 8 2 false discount 2 0.3 2.3 Hajar S 15 VAT 1 2 

when using CLI command the hash is:  
MVwXbk2UA9iyJ9fMIzCKlrwQba5aAMAX3eoIGcTXxTQ=

when using dotnet class the hash is:  
CDl9of6kuoTe2yc1gN6gt4ty5ViFK6eu5Q9Cn2Km9hw=

can you help me about this problem?

---

<div class="post-metadata">

**Author:** ![idaoud](https://avatars.discourse-cdn.com/v4/letter/i/f9ae1b/32.png) [@idaoud](https://zatca1.discourse.group/u/idaoud)\
**Post date:** [September 22, 2024, 9:07am UTC](https://zatca1.discourse.group/t/error-hashing-in-latest-sdk-3-3-5/3185/2 "2024-09-22T09:07:05Z")

</div>

Dear @Abdulraouf

Thanks for reaching out, Welcome to our community.

Can I kindly ask you to elaborate more your concerns,

What is the [SDK.Net](http://SDK.Net) version you are using?  
Did you complete all the compliance checks?  
What is the exact response from the API?

Thanks,  
Ibrahem Daoud.

---

<div class="post-metadata">

**Author:** ![Abdulraouf](https://avatars.discourse-cdn.com/v4/letter/a/e9c0ed/32.png) [@Abdulraouf](https://zatca1.discourse.group/u/Abdulraouf)\
**Post date:** [September 26, 2024, 7:57am UTC](https://zatca1.discourse.group/t/error-hashing-in-latest-sdk-3-3-5/3185/3 "2024-09-26T07:57:13Z")

</div>

problem is solved when used  
doc.PreserveWhitespace = true befor load xmlDoc

before call signe function  
bad code:  
XmlDocument doc = new XmlDocument();  
doc.LoadXml(xmlInvoice);

this code is fix problem

XmlDocument doc = new XmlDocument();  
**doc.PreserveWhitespace = true;**  
doc.LoadXml(xmlInvoice);

thank you
