Jump to content

Create a Signature or checksum

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
3 replies to this topic

#1
shiranraviv

shiranraviv

    Newbie

  • Members
  • Pip
  • 1 posts
Hi,
I want to create a function which will tell if me the last packet i got from the server is identical to the one i got now.
I thought about put in an array and just compare the two but it will be very inefficient.
So, a checksum or a signature implementation will ( i think ...) do the work.
But how do i make a checksum for let say a const char * data type?

Any help will be thankful!

#2
dcs

dcs

    Programming God

  • Members
  • PipPipPipPipPipPipPip
  • 775 posts
A simple checksum is just a sum. Bytes are bytes; add them.

#3
marwex89

marwex89

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 10,720 posts
Well, there are actually quite a lot of ways to ensure proper communication. You gotta decide what's good enough for you, maybe a simple sum will be fine. Should probably start by reading this: Checksum - Wikipedia, the free encyclopedia
Hey! Check out my new Toyota keyboaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

#4
TkTech

TkTech

    The Crazy One

  • Moderators
  • 1,396 posts
I'm kind of confused - if you're talking about packet integrity - TCP does that for you.