Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

mortic::utilities Namespace Reference

A namespace that contains generic helper functions. More...


Functions

__utilities_h_extern__ unsigned
int 
hash (const std::string &str)
 A simple hash function.
__utilities_h_extern__ std::string itoa (int n)
 Convert an integer to a string.


Detailed Description

A namespace that contains generic helper functions.

This namespace is a place for generic helper functions that are useful in many places and usually come from other sources.


Function Documentation

__utilities_h_extern__ unsigned int mortic::utilities::hash const std::string &  str  ) 
 

A simple hash function.

This function generates a unique integer for a string. It is useful for passwords and many other things. This particular hash function is from an example on www.partow.net, and is under the Common Public License from http://www.opensource.org/licenses/cpl.php . All credit goes to them for such a wonderfully simple function.

  • str - the string to make the hash from
    Returns:
    an integer based on the hash

__utilities_h_extern__ std::string mortic::utilities::itoa int  n  ) 
 

Convert an integer to a string.

This function is copyright 2006 Priyadarsan, with the original code from http://www.freebookzone.com/others/itoa.h. It is only slightly modified to use std strings.

  • n - the integer to convert
    Returns:
    the new string


Generated on Sat Dec 30 21:21:59 2006 for mortic by  doxygen 1.4.4