Free Support Forum - aspose.com

Different hash generated for two identical output file


#1

Hi,

My application need to generate hash with processed file (process using Aspose library .net [words, pdf, cells, slide]). For the same input file, I processed it twice but the hash for each output file is different from one another.

From what I tested so far, these file type will generate diff hash for identical output file:

  • xlsx
  • docx
  • pdf
  • ppt
  • pptx
  • xps/oxps

Only these file type will generate same hash for identical output file:

  • doc
  • xls (80% of my sample file generate the same hash)

Pdf file is the only one that I can see the difference of id and date in the pdf document using the windows’s fc cmd. I have attached the screenshot with the sample application zip file.

Can I know is it possible to fix/toggle it and what it is causing two identical output file to have two diff hash ?

Here are some of my test file and sample console application on processing words documents.

sample_application.zip (2.4 MB)

Thanks.


#2

@zhilin39,

I have observed your comments. Can you please share complete working sample project to reproduce issue. I like to inform that code snippet you provided is only related to Aspose.Words API and for further investigation we need other APIs code and hashcode tool details. Also we need more details about which APIs you are using to get hashcodes for the generated files by Aspose APIs. Can you please share what is the purpose to get or generate hash code from the documents (DOCX, XLSX, PPT, PDF, etc.)


#3

@Adnan.Ahmad

Hi,

Sorry for the late reply.

I’m using nodejs’s hashing library to generate the hash code of the file.

The purpose of generating hash code is that the API I’m using requires hash code of the file as the input instead of uploading file to the API. If hash code was generating different hash code for the same output file, the API would take it as two different file and process it again.

I have re-upload a more complete working sample project with all the all the file type I mention previously and a sample nodejs project(in .js) in case you need it as well.

sample_application_2.zip (2.4 MB)

Aspose lib ver. used in this sample project:

Words - 19.2
Excel - 19.2
Slide - 19.1
PDF - 19.2

Thanks.


#4

@zhilin39,

Thanks for sharing requested information. I like to inform that we are investigating issue and will get back to you with feedback soon.


#5

@zhilin39

Thank you for being patient.

We would like to update you that if you resave the files with MS Word, MS Excel or MS PowerPoint then the hash code information will be different for input and output document. So, it is not an issue in Aspose.Words, Aspose.Cells or Aspose.Slides respectively.

Regarding Aspose.PDF for .NET API, a ticket with ID PDFNET-46069 has been logged in our issue management system for further investigations. We will let you know as soon as any progress will be made in this regard.

We are sorry for the inconvenience.