Package ch.bailu.gtk.glib
Klasse Checksum
java.lang.Object
ch.bailu.gtk.type.Type
ch.bailu.gtk.type.Pointer
ch.bailu.gtk.type.Record
ch.bailu.gtk.glib.Checksum
- Alle implementierten Schnittstellen:
PointerInterface
GLib provides a generic API for computing checksums (or ‘digests’)
for a sequence of arbitrary bytes, using various hashing algorithms
like MD5, SHA-1 and SHA-256. Checksums are commonly used in various
environments and specifications.
To create a new `GChecksum`, use [ctor@GLib.Checksum.new]. To free
a `GChecksum`, use [method@GLib.Checksum.free].
GLib supports incremental checksums using the `GChecksum` data
structure, by calling [method@GLib.Checksum.update] as long as there’s data
available and then using [method@GLib.Checksum.get_string] or
[method@GLib.Checksum.get_digest] to compute the checksum and return it
either as a string in hexadecimal form, or as a raw sequence of bytes. To
compute the checksum for binary blobs and nul-terminated strings in
one go, use the convenience functions [func@GLib.compute_checksum_for_data]
and [func@GLib.compute_checksum_for_string], respectively.
for a sequence of arbitrary bytes, using various hashing algorithms
like MD5, SHA-1 and SHA-256. Checksums are commonly used in various
environments and specifications.
To create a new `GChecksum`, use [ctor@GLib.Checksum.new]. To free
a `GChecksum`, use [method@GLib.Checksum.free].
GLib supports incremental checksums using the `GChecksum` data
structure, by calling [method@GLib.Checksum.update] as long as there’s data
available and then using [method@GLib.Checksum.get_string] or
[method@GLib.Checksum.get_digest] to compute the checksum and return it
either as a string in hexadecimal form, or as a raw sequence of bytes. To
compute the checksum for binary blobs and nul-terminated strings in
one go, use the convenience functions [func@GLib.compute_checksum_for_data]
and [func@GLib.compute_checksum_for_string], respectively.
-
Feldübersicht
-
Konstruktorübersicht
KonstruktorenKonstruktorBeschreibungChecksum
(int checksum_type) Creates a new #GChecksum, using the checksum algorithm @checksum_type.Checksum
(PointerContainer pointer) -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungcopy()
Copies a #GChecksum.void
free()
Frees the memory allocated for @checksum.static ClassHandler
static int
static long
static TypeSystem.TypeSize
Gets the digest as a hexadecimal string.static long
static TypeSystem.TypeSize
void
reset()
Resets the state of the @checksum back to its initial state.static long
typeGetLength
(int checksum_type) Gets the length in bytes of digests of type @checksum_typeVon Klasse geerbte Methoden ch.bailu.gtk.type.Pointer
asCPointer, cast, connectSignal, disconnectSignals, disconnectSignals, equals, hashCode, throwIfNull, throwNullPointerException, toString, unregisterCallbacks, unregisterCallbacks
Von Klasse geerbte Methoden ch.bailu.gtk.type.Type
asCPointer, asCPointer, asCPointerNotNull, asJnaPointer, asJnaPointer, asPointer, asPointer, cast, cast, throwIfNull
Von Klasse geerbte Methoden java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Von Schnittstelle geerbte Methoden ch.bailu.gtk.type.PointerInterface
asCPointerNotNull, asJnaPointer, asPointer, isNotNull, isNull
-
Konstruktordetails
-
Checksum
-
Checksum
public Checksum(int checksum_type) 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.
A #GChecksum works by feeding a binary blob through g_checksum_update()
until there is data to be checked; the digest can then be extracted
using g_checksum_get_string(), which will return the checksum as a
hexadecimal string; or g_checksum_get_digest(), which will return a
vector of raw bytes. Once either g_checksum_get_string() or
g_checksum_get_digest() have been called on a #GChecksum, the checksum
will be closed and it won't be possible to call g_checksum_update()
on it anymore.- Parameter:
checksum_type
- the desired type of checksum
-
-
Methodendetails
-
getClassHandler
-
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.- Gibt zurück:
- the copy of the passed #GChecksum. Use g_checksum_free() when finished using it.
-
free
public void free()Frees the memory allocated for @checksum. -
getString
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.- Gibt zurück:
- the hexadecimal representation of the checksum. The returned string is owned by the checksum and should not be modified or freed.
-
reset
public void reset()Resets the state of the @checksum back to its initial state. -
typeGetLength
public static long typeGetLength(int checksum_type) Gets the length in bytes of digests of type @checksum_type- Parameter:
checksum_type
- a #GChecksumType- Gibt zurück:
- the checksum length, or -1 if @checksum_type is not supported.
-
getTypeID
public static long getTypeID() -
getParentTypeID
public static long getParentTypeID() -
getTypeSize
-
getParentTypeSize
-
getInstanceSize
public static int getInstanceSize()
-