Support Forum       G3D Web Page     
Static Public Member Functions | List of all members
G3D::Crypto Class Reference

Cryptography and hashing helper functions. More...

Static Public Member Functions

static uint32 crc32 (const void *bytes, size_t numBytes)
 
Computes the CRC32 value of a byte array. More...
 
static MD5Hash md5 (const void *bytes, size_t numBytes)
 
Computes the MD5 hash (message digest) of a byte stream, as defined by http://www.ietf.org/rfc/rfc1321.txt. More...
 
static int numSmallPrimes ()
 Returns 1 + the largest value that can be passed to smallPrime. More...
 
static int smallPrime (int n)
 
Returns the nth prime less than 2000 in constant time. More...
 

Detailed Description

Cryptography and hashing helper functions.

Member Function Documentation

◆ crc32()

static uint32 G3D::Crypto::crc32 ( const void *  bytes,
size_t  numBytes 
)
static


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/

◆ md5()

static MD5Hash G3D::Crypto::md5 ( const void *  bytes,
size_t  numBytes 
)
static


Computes the MD5 hash (message digest) of a byte stream, as defined by http://www.ietf.org/rfc/rfc1321.txt.

Referenced Code: Based on implementation by L. Peter Deutsch, ghost.com

◆ numSmallPrimes()

static int G3D::Crypto::numSmallPrimes ( )
static

Returns 1 + the largest value that can be passed to smallPrime.

◆ smallPrime()

static int G3D::Crypto::smallPrime ( int  n)
static


Returns the nth prime less than 2000 in constant time.

The first prime has index 0 and is the number 2.


documentation generated on Wed Nov 24 2021 08:01:54 using doxygen 1.8.15