CS::Utility::Checksum::SHA256 Class Reference (Crystal Space 2.0 Public API Reference)

| ## Public API Reference

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Types | Public Member Functions | Static Public Member Functions
CS::Utility::Checksum::SHA256 Class Reference

Compute a SHA-256 message digest. More...

`#include <csutil/sha256.h>`

List of all members.

## Public Types
typedef CS::Utility::Checksum::Digest< 32 > | Digest
| A SHA256 digest is 32 unsigned characters (not 0-terminated).
## Public Member Functions
void | Append (const uint8 *input, size_t length)
| Used to update the the input data hash.
Digest | Finish ()
| Used to complete the hashing process and obtain the calculated hash.
## Static Public Member Functions
static Digest | Encode (csString const &)
| Encode a string.
static Digest | Encode (const char *)
| Encode a null-terminated string buffer.
static Digest | Encode (const void *, size_t nbytes)
| Encode a buffer.

## Detailed Description

Compute a SHA-256 message digest.

This class provides an interface to compute a digest in a "streaming" manner (the message can be split into chunks which are processed sequentially) as well as a convenient interface which allows one to create a digest in a single step.

Definition at line 44 of file sha256.h.

## Member Typedef Documentation

typedef CS::Utility::Checksum::Digest<32> CS::Utility::Checksum::SHA256::Digest

A SHA256 digest is 32 unsigned characters (not 0-terminated).

Definition at line 67 of file sha256.h.

## Member Function Documentation

void CS::Utility::Checksum::SHA256::Append | ( | const uint8 * | input,
|  | size_t | length
| ) |  |

Used to update the the input data hash.

Parameters:

  input | A pointer to an array of the input data with which to update the hash.
  length | The length of the input data to hash (in bytes).

static Digest CS::Utility::Checksum::SHA256::Encode | ( | csString const & |  | ) | `[static]`

Encode a string.

static Digest CS::Utility::Checksum::SHA256::Encode | ( | const char * |  | ) | `[static]`

Encode a null-terminated string buffer.

static Digest CS::Utility::Checksum::SHA256::Encode | ( | const void * | ,
|  | size_t | nbytes
| ) |  | `[static]`

Encode a buffer.

Digest CS::Utility::Checksum::SHA256::Finish | ( |  | ) |

Used to complete the hashing process and obtain the calculated hash.

After finishing, don't append further data to the hash -- the resulting digest will be bogus.

Returns:
  The calculated hash.

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

- csutil/sha256.h