Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6961053
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T15:28:51+00:00 2026-05-27T15:28:51+00:00

I am saving some Objects I have defined from my own classes, to File.

  • 0

I am saving some Objects I have defined from my own classes, to File. (saving the stream data).

That is all fine, but I would like to be able to store in the File the CRC checksum of that File.

Then, whenever my Application attemps to Open a File, it can read the internally stored CRC value.

Then perform a check on the actual File, if the CRC of the File matches the internally stored CRC value I can process the File normally, otherwise display an error message to say the File is not valid.

I need some advice on how to do this though, I thought I could do something like this:

  • Save the File from my Application.
  • Calculate the CRC of the Saved File.
  • Edit the Saved File storing the CRC Value.
  • Whenever a File is Opened, Check the CRC matches internal CRC Value.

Problem is, as soon as a single Byte of Data is altered in the File, results in the CRC checksum being completely different – as expected.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T15:28:52+00:00Added an answer on May 27, 2026 at 3:28 pm

    Simply put you need to exclude the bytes used to store the checksum from the checksum calculation.

    Write the checksum as the last thing in the file. Calculate it based on the contents of the file apart from the checksum. When you come to read the file calculate the checksum based on the contents before the checksum. Or you could write the checksum as the first bytes of the file with random access. Just so long as you know where it is.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to write some methods for loading/saving some classes to and from a
I have a action class for saving some data to a database.In action class
I have created a web service which is saving some data into to db.
I'm getting some data from the web service and saving it in the core
I'm witnessing some strange behaviour from Fluent nHibernate. I have two objects involved in
I've some classes defined in a dll file. These are in the form of
In java i am writing some DTO objects, which all inherit from AllocationDTO .
Okay, I'm having a problem saving after I've deleted all the objects I have
I have a DataSet with some Datatables and I am saving this DataSet as
I am trying to make saving and loading easier for some GUIs that I've

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.