hash

M

mikethebike

HI
I don't understand. What does this function?
( I'm looking for an easy hash en- decrypt function )
Many thanks
Michael


std::map<std::string, int> string_int_hash;

string_int_hash.insert(std::make_pair("foo", 200) );
string_int_hash["bar"] = 12;

std::cout << "foo:" << string_int_hash["foo"] << std::endl;
std::cout << "bar:" << string_int_hash["bar"] << std::endl;
 
V

Victor Bazarov

mikethebike wrote (only 12 minutes after the first post with the same
content):
HI
I don't understand. [..]

Patience is a virtue. This is not a chat room.
 
J

Jonathan Lee

I don't understand. What does this function?

It adds two items to a map. A map associates the first item, called
the key, with the second. When you access the map by the key it
returns the value last associated with that key.

I think cplusplus.com has a decent write up with examples which
explain the notation.
( I'm looking for an easy hash en- decrypt function )

Well, this is neither a hash nor a cipher (note that you can't use a
hash to en-/de-crypt). A relatively simple hash is MD5, though people
complain about its security status. If that's a problem then move to
SHA-2, though those hashes are more complicated.

If you're looking for an *easy* encryption/decryption function use
ARCFOUR. Again -- some security concerns there. AES and Serpent are
secure alternatives, but are more complicated.

--Jonathan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,780
Messages
2,569,608
Members
45,253
Latest member
BlytheFant

Latest Threads

Top