Class Checksum

All Implemented Interfaces:
PointerInterface

public class Checksum extends Record
An opaque structure representing a checksumming operation.

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

https://docs.gtk.org/glib/struct.Checksum.html

  • Constructor Details

    • Checksum

      public Checksum(PointerContainer pointer)
    • 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.
      Parameters:
      checksum_type - the desired type of checksum
  • Method Details

    • getClassHandler

      public static ClassHandler getClassHandler()
    • copy

      public 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.
      Returns:
      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

      public Str 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.
      Returns:
      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
      Parameters:
      checksum_type - a #GChecksumType
      Returns:
      the checksum length, or -1 if @checksum_type is not supported.
    • getTypeID

      public static long getTypeID()
    • getParentTypeID

      public static long getParentTypeID()
    • getTypeSize

      public static TypeSystem.TypeSize getTypeSize()
    • getParentTypeSize

      public static TypeSystem.TypeSize getParentTypeSize()
    • getInstanceSize

      public static int getInstanceSize()