<GChecksum>

<GChecksum>

Description

An opaque structure representing a checksumming operation.

To create a new GChecksum, use g_checksum_new(). To free a GChecksum, use g_checksum_free().

Functions

copy

(define-values (%return) (checksum:copy self))

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.

Parameters

checksum

the GChecksum to copy

Passed as self

free

(define-values () (checksum:free self))

Frees the memory allocated for checksum.

Parameters

checksum

a GChecksum

Passed as self

get-string

(define-values (%return) (checksum:get-string self))

Gets the digest as a hexadecimal string.

Once this function has been called the GChecksum can no longer be updated with g_checksum_update().

The hexadecimal characters will be lower case.

Parameters

checksum

a GChecksum

Passed as self

reset

(define-values () (checksum:reset self))

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

Parameters

checksum

the GChecksum to reset

Passed as self

update

(define-values () (checksum:update self 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.

Parameters

checksum

a GChecksum

Passed as self

data

buffer used to compute the checksum

Passed as data

length

size of the buffer, or -1 if it is a null-terminated string.

Inferred from data

checksum:new

(define-values (%return) (checksum:new checksum-type))

Undocumented

Parameters

checksum_type

Passed as checksum-type

checksum:type-get-length

(define-values (%return) (checksum:type-get-length checksum-type))

Gets the length in bytes of digests of type checksum_type

Parameters

checksum_type

a GChecksumType

Passed as checksum-type