Jump to content

Hashing

- - - - -

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

#1
Guest_NeedHelp_*

Guest_NeedHelp_*
  • Guests
I have to create a program using hashing but I'm not even sure what it is. Can someone explain this to me and how to use it in C++?

#2
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
A hash is a value generated from another value. Basicly, it's an n to 1 function that can be used with a reasonably high certainty to detect different inputs. Software keys are passed through a hash function to detect valid keys. Hash tables use the hash of an input to organize values, making input easier. CRC and MD5 are also examples of hashes. To implement it in C++, simply create a function "[return type] hash(string input)" and define the output string via any useful algorithm you come up with.

Note: having a program check its own hash might be a useful way to help protect it from being cracked.
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

#3
Frantic

Frantic

    Learning Programmer

  • Members
  • PipPipPip
  • 91 posts
How do you make a program check its own hash though?

#4
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
Store the hash in a seperate file, possibly encrypted, etc. Or create a hash collision.
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog