Gjsify LogoGjsify Logo

An opaque structure representing a checksumming operation.

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

record

Hierarchy

  • Checksum

Index

Constructors

  • 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

    Returns GLib.Checksum

Properties

name: string

Methods

  • 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 GLib.Checksum

  • free(): void
  • get_string(): string
  • 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 string

  • reset(): void
  • update(data: Uint8Array): void
  • 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

    • data: Uint8Array

      buffer used to compute the checksum

    Returns void

  • 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

    Returns GLib.Checksum

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Type alias with type parameter
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method