Code Search for Developers
 
 
  

Crypto.h from MaNGOS at Krugle


Show Crypto.h syntax highlighted

/** 
  @file Crypto.h
 
  @maintainer Morgan McGuire, matrix@graphics3d.com
 

  @created 2006-03-29
  @edited  2006-04-06
 */

#ifndef G3D_CRYPTO_H
#define G3D_CRYPTO_H

#include "G3D/platform.h"
#include "G3D/g3dmath.h"
#include <string>

namespace G3D {

/** Cryptography and hashing helper functions */
class Crypto {
public:

    /**
     Computes the CRC32 value of a byte array.  CRC32 is designed to be a hash
     function that produces different values for similar strings.

     This implementation is compatible with PKZIP and GZIP.

     Based on http://www.gamedev.net/reference/programming/features/crc32/
    */
    static uint32 crc32(const void* bytes, size_t numBytes);

    /**
     Returns the nth prime less than 2000 in constant time.  The first prime has index
     0 and is the number 2.
     */
    static int smallPrime(int n);

    /** Returns 1 + the largest value that can be passed to smallPrime. */
    static int numSmallPrimes();
};

}

#endif




See more files for this project here

MaNGOS

MaNGOS is an object-oriented Massively Multiplayer Online Role-Playing Game Server (MMORPGS). It\'s an educational project, to help developers get familar with large scale C++ and C# development projects.

Project homepage: http://sourceforge.net/projects/mangos
Programming language(s): C,C++,SQL
License: gpl2

  AABox.h
  Array.h
  Box.h
  CollisionDetection.h
  CoordinateFrame.h
  Crypto.h
  GCamera.h
  Line.h
  Matrix3.h
  Plane.h
  Quat.h
  Quat.inl
  Ray.h
  RegistryUtil.h
  Sphere.h
  System.h
  Table.h
  Triangle.h
  Vector2.h
  Vector2.inl
  Vector2int16.h
  Vector3.h
  Vector3.inl
  Vector3int16.h
  Vector4.h
  Vector4.inl
  debug.h
  format.h
  g3dmath.h
  g3dmath.inl
  platform.h
  stringutils.h