Checksum

An opaque structure representing a checksumming operation. To create a new GChecksum, use g_checksum_new(). To free a GChecksum, use g_checksum_free().

Constructors

this
this(GChecksum* gChecksum, bool ownedRef)

Sets our main struct and passes it to the parent class.

this
this(GChecksumType checksumType)

Creates a new #GChecksum, using the checksum algorithm @checksum_type. If the @checksum_type is not known, %NULL is returned. A #GChecksum can be used to compute the checksum, or digest, of an arbitrary binary blob, using different hashing algorithms.

Destructor

~this
~this()
Undocumented in source.

Members

Functions

copy
Checksum copy()

Copies a #GChecksum. If @checksum has been closed, by calling g_checksum_get_string() or g_checksum_get_digest(), the copied checksum will be closed as well.

free
void free()

Frees the memory allocated for @checksum.

getChecksumStruct
GChecksum* getChecksumStruct(bool transferOwnership)

Get the main Gtk struct

getDigest
void getDigest(ubyte[] buffer)

Gets the digest from checksum as a raw binary vector and places it into buffer. The size of the digest depends on the type of checksum.

getString
string getString()

Gets the digest as a hexadecimal string.

getStruct
void* getStruct()

the main Gtk struct as a void*

reset
void reset()

Resets the state of the @checksum back to its initial state.

update
void update(char[] data)

Feeds @data into an existing #GChecksum. The checksum must still be open, that is g_checksum_get_string() or g_checksum_get_digest() must not have been called on @checksum.

Static functions

computeChecksumForBytes
string computeChecksumForBytes(GChecksumType checksumType, Bytes data)

Computes the checksum for a binary @data. This is a convenience wrapper for g_checksum_new(), g_checksum_get_string() and g_checksum_free().

computeChecksumForData
string computeChecksumForData(GChecksumType checksumType, char[] data)

Computes the checksum for a binary @data of @length. This is a convenience wrapper for g_checksum_new(), g_checksum_get_string() and g_checksum_free().

computeChecksumForString
string computeChecksumForString(GChecksumType checksumType, string str, ptrdiff_t length)

Computes the checksum of a string.

typeGetLength
ptrdiff_t typeGetLength(GChecksumType checksumType)

Gets the length in bytes of digests of type @checksum_type

Variables

gChecksum
GChecksum* gChecksum;

the main Gtk struct

ownedRef
bool ownedRef;
Undocumented in source.

Meta

Since

2.16