clan::HashFunctions Class Reference - ClanLib SDK
Description: clan::HashFunctions Class Reference

Static Public Member Functions | List of all members
clan::HashFunctions Class Reference
clanCore Crypto

A Collection of checksum functions. More...

`#include <hash_functions.h>`

## Static Public Member Functions
static uint32_t | adler32 (const void *data, int size, uint32_t running_adler32=0)
| Calculate a CRC32 checksum on the data.
static uint32_t | crc32 (const void *data, int size, uint32_t running_crc=0)
| Calculate a CRC32 checksum on the data.
static std::string | md5 (const DataBuffer &data, bool uppercase=false)
| MD5.
static void | md5 (const DataBuffer &data, unsigned char out_hash[16])
| MD5.
static std::string | md5 (const std::string &data, bool uppercase=false)
| MD5.
static void | md5 (const std::string &data, unsigned char out_hash[16])
| MD5.
static std::string | md5 (const void *data, int size, bool uppercase=false)
| Generate SHA-1 hash from data.
static void | md5 (const void *data, int size, unsigned char out_hash[16])
| MD5.
static std::string | sha1 (const DataBuffer &data, bool uppercase=false)
| SHA1.
static void | sha1 (const DataBuffer &data, unsigned char out_hash[20])
| SHA1.
static std::string | sha1 (const std::string &data, bool uppercase=false)
| SHA1.
static void | sha1 (const std::string &data, unsigned char out_hash[20])
| SHA1.
static std::string | sha1 (const void *data, int size, bool uppercase=false)
| Generate SHA-1 hash from data.
static void | sha1 (const void *data, int size, unsigned char out_hash[20])
| SHA1.
static std::string | sha224 (const DataBuffer &data, bool uppercase=false)
| SHA224.
static void | sha224 (const DataBuffer &data, unsigned char out_hash[28])
| SHA224.
static std::string | sha224 (const std::string &data, bool uppercase=false)
| SHA224.
static void | sha224 (const std::string &data, unsigned char out_hash[28])
| SHA224.
static std::string | sha224 (const void *data, int size, bool uppercase=false)
| Generate SHA-224 hash from data.
static void | sha224 (const void *data, int size, unsigned char out_hash[28])
| SHA224.
static std::string | sha256 (const DataBuffer &data, bool uppercase=false)
| SHA256.
static void | sha256 (const DataBuffer &data, unsigned char out_hash[32])
| SHA256.
static std::string | sha256 (const std::string &data, bool uppercase=false)
| SHA256.
static void | sha256 (const std::string &data, unsigned char out_hash[32])
| SHA256.
static std::string | sha256 (const void *data, int size, bool uppercase=false)
| Generate SHA-256 hash from data.
static void | sha256 (const void *data, int size, unsigned char out_hash[32])
| SHA256.
static std::string | sha384 (const DataBuffer &data, bool uppercase=false)
| SHA384.
static void | sha384 (const DataBuffer &data, unsigned char out_hash[48])
| SHA384.
static std::string | sha384 (const std::string &data, bool uppercase=false)
| SHA384.
static void | sha384 (const std::string &data, unsigned char out_hash[48])
| SHA384.
static std::string | sha384 (const void *data, int size, bool uppercase=false)
| Generate SHA-384 hash from data.
static void | sha384 (const void *data, int size, unsigned char out_hash[48])
| SHA384.
static std::string | sha512 (const DataBuffer &data, bool uppercase=false)
| SHA512.
static void | sha512 (const DataBuffer &data, unsigned char out_hash[64])
| SHA512.
static std::string | sha512 (const std::string &data, bool uppercase=false)
| SHA512.
static void | sha512 (const std::string &data, unsigned char out_hash[64])
| SHA512.
static std::string | sha512 (const void *data, int size, bool uppercase=false)
| Generate SHA-512 hash from data.
static void | sha512 (const void *data, int size, unsigned char out_hash[64])
| SHA512.
static std::string | sha512_224 (const DataBuffer &data, bool uppercase=false)
| SHA512_224.
static void | sha512_224 (const DataBuffer &data, unsigned char out_hash[28])
| SHA512_224.
static std::string | sha512_224 (const std::string &data, bool uppercase=false)
| SHA512_224.
static void | sha512_224 (const std::string &data, unsigned char out_hash[28])
| SHA512_224.
static std::string | sha512_224 (const void *data, int size, bool uppercase=false)
| Generate SHA-512_224 hash from data.
static void | sha512_224 (const void *data, int size, unsigned char out_hash[28])
| SHA512_224.
static std::string | sha512_256 (const DataBuffer &data, bool uppercase=false)
| SHA512_256.
static void | sha512_256 (const DataBuffer &data, unsigned char out_hash[32])
| SHA512_256.
static std::string | sha512_256 (const std::string &data, bool uppercase=false)
| SHA512_256.
static void | sha512_256 (const std::string &data, unsigned char out_hash[32])
| SHA512_256.
static std::string | sha512_256 (const void *data, int size, bool uppercase=false)
| Generate SHA-512_256 hash from data.
static void | sha512_256 (const void *data, int size, unsigned char out_hash[32])
| SHA512_256.

## Detailed Description

A Collection of checksum functions.

## Member Function Documentation

## ◆ adler32()

static uint32_t clan::HashFunctions::adler32 | ( | const void * | data,
|  | int | size,
|  | uint32_t | running_adler32 = 0 )
| static

Calculate a CRC32 checksum on the data.

## ◆ crc32()

static uint32_t clan::HashFunctions::crc32 | ( | const void * | data,
|  | int | size,
|  | uint32_t | running_crc = 0 )
| static

Calculate a CRC32 checksum on the data.

## ◆ md5() [1/6]

static std::string clan::HashFunctions::md5 | ( | const DataBuffer & | data,
|  | bool | uppercase = false )
| static

MD5.

Parameters

  data | = Data Buffer
  uppercase | = bool

Returns
  String8

## ◆ md5() [2/6]

static void clan::HashFunctions::md5 | ( | const DataBuffer & | data,
|  | unsigned char | out_hash[16] )
| static

MD5.

Parameters

  data | = Data Buffer
  out_hash | = char

## ◆ md5() [3/6]

static std::string clan::HashFunctions::md5 | ( | const std::string & | data,
|  | bool | uppercase = false )
| static

MD5.

Parameters

  data | = String Ref8
  uppercase | = bool

Returns
  String8

## ◆ md5() [4/6]

static void clan::HashFunctions::md5 | ( | const std::string & | data,
|  | unsigned char | out_hash[16] )
| static

MD5.

Parameters

  data | = String Ref8
  out_hash | = char

## ◆ md5() [5/6]

static std::string clan::HashFunctions::md5 | ( | const void * | data,
|  | int | size,
|  | bool | uppercase = false )
| static

Generate SHA-1 hash from data.

## ◆ md5() [6/6]

static void clan::HashFunctions::md5 | ( | const void * | data,
|  | int | size,
|  | unsigned char | out_hash[16] )
| static

MD5.

Parameters

  data | = void
  size | = value
  out_hash | = char

## ◆ sha1() [1/6]

static std::string clan::HashFunctions::sha1 | ( | const DataBuffer & | data,
|  | bool | uppercase = false )
| static

SHA1.

Parameters

  data | = Data Buffer
  uppercase | = bool

Returns
  String8

## ◆ sha1() [2/6]

static void clan::HashFunctions::sha1 | ( | const DataBuffer & | data,
|  | unsigned char | out_hash[20] )
| static

SHA1.

Parameters

  data | = Data Buffer
  out_hash | = char

## ◆ sha1() [3/6]

static std::string clan::HashFunctions::sha1 | ( | const std::string & | data,
|  | bool | uppercase = false )
| static

SHA1.

Parameters

  data | = String Ref8
  uppercase | = bool

Returns
  String8

## ◆ sha1() [4/6]

static void clan::HashFunctions::sha1 | ( | const std::string & | data,
|  | unsigned char | out_hash[20] )
| static

SHA1.

Parameters

  data | = String Ref8
  out_hash | = char

## ◆ sha1() [5/6]

static std::string clan::HashFunctions::sha1 | ( | const void * | data,
|  | int | size,
|  | bool | uppercase = false )
| static

Generate SHA-1 hash from data.

## ◆ sha1() [6/6]

static void clan::HashFunctions::sha1 | ( | const void * | data,
|  | int | size,
|  | unsigned char | out_hash[20] )
| static

SHA1.

Parameters

  data | = void
  size | = value
  out_hash | = char

## ◆ sha224() [1/6]

static std::string clan::HashFunctions::sha224 | ( | const DataBuffer & | data,
|  | bool | uppercase = false )
| static

SHA224.

Parameters

  data | = Data Buffer
  uppercase | = bool

Returns
  String8

## ◆ sha224() [2/6]

static void clan::HashFunctions::sha224 | ( | const DataBuffer & | data,
|  | unsigned char | out_hash[28] )
| static

SHA224.

Parameters

  data | = Data Buffer
  out_hash | = char

## ◆ sha224() [3/6]

static std::string clan::HashFunctions::sha224 | ( | const std::string & | data,
|  | bool | uppercase = false )
| static

SHA224.

Parameters

  data | = String Ref8
  uppercase | = bool

Returns
  String8

## ◆ sha224() [4/6]

static void clan::HashFunctions::sha224 | ( | const std::string & | data,
|  | unsigned char | out_hash[28] )
| static

SHA224.

Parameters

  data | = String Ref8
  out_hash | = char

## ◆ sha224() [5/6]

static std::string clan::HashFunctions::sha224 | ( | const void * | data,
|  | int | size,
|  | bool | uppercase = false )
| static

Generate SHA-224 hash from data.

## ◆ sha224() [6/6]

static void clan::HashFunctions::sha224 | ( | const void * | data,
|  | int | size,
|  | unsigned char | out_hash[28] )
| static

SHA224.

Parameters

  data | = void
  size | = value
  out_hash | = char

## ◆ sha256() [1/6]

static std::string clan::HashFunctions::sha256 | ( | const DataBuffer & | data,
|  | bool | uppercase = false )
| static

SHA256.

Parameters

  data | = Data Buffer
  uppercase | = bool

Returns
  String8

## ◆ sha256() [2/6]

static void clan::HashFunctions::sha256 | ( | const DataBuffer & | data,
|  | unsigned char | out_hash[32] )
| static

SHA256.

Parameters

  data | = Data Buffer
  out_hash | = char

## ◆ sha256() [3/6]

static std::string clan::HashFunctions::sha256 | ( | const std::string & | data,
|  | bool | uppercase = false )
| static

SHA256.

Parameters

  data | = String Ref8
  uppercase | = bool

Returns
  String8

## ◆ sha256() [4/6]

static void clan::HashFunctions::sha256 | ( | const std::string & | data,
|  | unsigned char | out_hash[32] )
| static

SHA256.

Parameters

  data | = String Ref8
  out_hash | = char

## ◆ sha256() [5/6]

static std::string clan::HashFunctions::sha256 | ( | const void * | data,
|  | int | size,
|  | bool | uppercase = false )
| static

Generate SHA-256 hash from data.

## ◆ sha256() [6/6]

static void clan::HashFunctions::sha256 | ( | const void * | data,
|  | int | size,
|  | unsigned char | out_hash[32] )
| static

SHA256.

Parameters

  data | = void
  size | = value
  out_hash | = char

## ◆ sha384() [1/6]

static std::string clan::HashFunctions::sha384 | ( | const DataBuffer & | data,
|  | bool | uppercase = false )
| static

SHA384.

Parameters

  data | = Data Buffer
  uppercase | = bool

Returns
  String8

## ◆ sha384() [2/6]

static void clan::HashFunctions::sha384 | ( | const DataBuffer & | data,
|  | unsigned char | out_hash[48] )
| static

SHA384.

Parameters

  data | = Data Buffer
  out_hash | = char

## ◆ sha384() [3/6]

static std::string clan::HashFunctions::sha384 | ( | const std::string & | data,
|  | bool | uppercase = false )
| static

SHA384.

Parameters

  data | = String Ref8
  uppercase | = bool

Returns
  String8

## ◆ sha384() [4/6]

static void clan::HashFunctions::sha384 | ( | const std::string & | data,
|  | unsigned char | out_hash[48] )
| static

SHA384.

Parameters

  data | = String Ref8
  out_hash | = char

## ◆ sha384() [5/6]

static std::string clan::HashFunctions::sha384 | ( | const void * | data,
|  | int | size,
|  | bool | uppercase = false )
| static

Generate SHA-384 hash from data.

## ◆ sha384() [6/6]

static void clan::HashFunctions::sha384 | ( | const void * | data,
|  | int | size,
|  | unsigned char | out_hash[48] )
| static

SHA384.

Parameters

  data | = void
  size | = value
  out_hash | = char

## ◆ sha512() [1/6]

static std::string clan::HashFunctions::sha512 | ( | const DataBuffer & | data,
|  | bool | uppercase = false )
| static

SHA512.

Parameters

  data | = Data Buffer
  uppercase | = bool

Returns
  String8

## ◆ sha512() [2/6]

static void clan::HashFunctions::sha512 | ( | const DataBuffer & | data,
|  | unsigned char | out_hash[64] )
| static

SHA512.

Parameters

  data | = Data Buffer
  out_hash | = char

## ◆ sha512() [3/6]

static std::string clan::HashFunctions::sha512 | ( | const std::string & | data,
|  | bool | uppercase = false )
| static

SHA512.

Parameters

  data | = String Ref8
  uppercase | = bool

Returns
  String8

## ◆ sha512() [4/6]

static void clan::HashFunctions::sha512 | ( | const std::string & | data,
|  | unsigned char | out_hash[64] )
| static

SHA512.

Parameters

  data | = String Ref8
  out_hash | = char

## ◆ sha512() [5/6]

static std::string clan::HashFunctions::sha512 | ( | const void * | data,
|  | int | size,
|  | bool | uppercase = false )
| static

Generate SHA-512 hash from data.

## ◆ sha512() [6/6]

static void clan::HashFunctions::sha512 | ( | const void * | data,
|  | int | size,
|  | unsigned char | out_hash[64] )
| static

SHA512.

Parameters

  data | = void
  size | = value
  out_hash | = char

## ◆ sha512_224() [1/6]

static std::string clan::HashFunctions::sha512_224 | ( | const DataBuffer & | data,
|  | bool | uppercase = false )
| static

SHA512_224.

Parameters

  data | = Data Buffer
  uppercase | = bool

Returns
  String8

## ◆ sha512_224() [2/6]

static void clan::HashFunctions::sha512_224 | ( | const DataBuffer & | data,
|  | unsigned char | out_hash[28] )
| static

SHA512_224.

Parameters

  data | = Data Buffer
  out_hash | = char

## ◆ sha512_224() [3/6]

static std::string clan::HashFunctions::sha512_224 | ( | const std::string & | data,
|  | bool | uppercase = false )
| static

SHA512_224.

Parameters

  data | = String Ref8
  uppercase | = bool

Returns
  String8

## ◆ sha512_224() [4/6]

static void clan::HashFunctions::sha512_224 | ( | const std::string & | data,
|  | unsigned char | out_hash[28] )
| static

SHA512_224.

Parameters

  data | = String Ref8
  out_hash | = char

## ◆ sha512_224() [5/6]

static std::string clan::HashFunctions::sha512_224 | ( | const void * | data,
|  | int | size,
|  | bool | uppercase = false )
| static

Generate SHA-512_224 hash from data.

## ◆ sha512_224() [6/6]

static void clan::HashFunctions::sha512_224 | ( | const void * | data,
|  | int | size,
|  | unsigned char | out_hash[28] )
| static

SHA512_224.

Parameters

  data | = void
  size | = value
  out_hash | = char

## ◆ sha512_256() [1/6]

static std::string clan::HashFunctions::sha512_256 | ( | const DataBuffer & | data,
|  | bool | uppercase = false )
| static

SHA512_256.

Parameters

  data | = Data Buffer
  uppercase | = bool

Returns
  String8

## ◆ sha512_256() [2/6]

static void clan::HashFunctions::sha512_256 | ( | const DataBuffer & | data,
|  | unsigned char | out_hash[32] )
| static

SHA512_256.

Parameters

  data | = Data Buffer
  out_hash | = char

## ◆ sha512_256() [3/6]

static std::string clan::HashFunctions::sha512_256 | ( | const std::string & | data,
|  | bool | uppercase = false )
| static

SHA512_256.

Parameters

  data | = String Ref8
  uppercase | = bool

Returns
  String8

## ◆ sha512_256() [4/6]

static void clan::HashFunctions::sha512_256 | ( | const std::string & | data,
|  | unsigned char | out_hash[32] )
| static

SHA512_256.

Parameters

  data | = String Ref8
  out_hash | = char

## ◆ sha512_256() [5/6]

static std::string clan::HashFunctions::sha512_256 | ( | const void * | data,
|  | int | size,
|  | bool | uppercase = false )
| static

Generate SHA-512_256 hash from data.

## ◆ sha512_256() [6/6]

static void clan::HashFunctions::sha512_256 | ( | const void * | data,
|  | int | size,
|  | unsigned char | out_hash[32] )
| static

SHA512_256.

Parameters

  data | = void
  size | = value
  out_hash | = char

The documentation for this class was generated from the following file:

- hash_functions.h