---
name: "libwget-hash"
section: "3"
platform: "linux"
package: "wget2-dev"
version: "2.2.0+ds-1+deb13u1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/libwget-hash"
---

# libwget-hash(3)

Hash convenience functions

## NAME

libwget-hash - Hash convenience functions

## SYNOPSIS

### Files

file **hashfile.c**\
 Hashing functions.

### Typedefs

typedef struct **wget\_hash\_hd\_st** **wget\_hash\_hd**\
 Type for hash / digest routines.

### Enumerations

enum **wget\_digest\_algorithm** { **WGET\_DIGTYPE\_UNKNOWN** = 0, **WGET\_DIGTYPE\_MD5**, **WGET\_DIGTYPE\_SHA1**, **WGET\_DIGTYPE\_RMD160**, **WGET\_DIGTYPE\_MD2**, **WGET\_DIGTYPE\_SHA256**, **WGET\_DIGTYPE\_SHA384**, **WGET\_DIGTYPE\_SHA512**, **WGET\_DIGTYPE\_SHA224**, **WGET\_DIGTYPE\_MAX** }\
 Enumeration of different hash digest algorithms.

### Functions

void **wget\_hash\_printf\_hex** (**wget\_digest\_algorithm** algorithm, char \*out, size\_t outsize, const char \*fmt,...)\

## Detailed Description

Provides Hash helper functions

## Enumeration Type Documentation

### enum wget\_digest\_algorithm

Enumeration of different hash digest algorithms.

**Enumerator**

- *WGET\_DIGTYPE\_UNKNOWN*

  *Indicates 'Unknown hash algorithm', returned by wget\_hash\_get\_algorithm()*

- *WGET\_DIGTYPE\_MD5*

  *Type 'MD5' digest*

- *WGET\_DIGTYPE\_SHA1*

  *Type SHA1 digest*

- *WGET\_DIGTYPE\_RMD160*

  *Type RMD160 digest*

- *WGET\_DIGTYPE\_MD2*

  *Type 'MD2' digest*

- *WGET\_DIGTYPE\_SHA256*

  *Type 'SHA256' digest*

- *WGET\_DIGTYPE\_SHA384*

  *Type 'SHA384' digest*

- *WGET\_DIGTYPE\_SHA512*

  *Type 'SHA512' digest*

- *WGET\_DIGTYPE\_SHA224*

  *Type 'SHA224' digest*

- *WGET\_DIGTYPE\_MAX*

  *Number of digest types*

## Function Documentation

### void wget\_hash\_printf\_hex (wget\_digest\_algorithm algorithm, char \* out, size\_t outsize, const char \* fmt, ...)

**Parameters**

*algorithm The hash algorithm to use* \
 *out Output string buffer* \
 *outsize Size of output string buffer* \
 *fmt Printf-like format specifier* \
 *... List of arguments*

*Calculate the hash from the string generated via the printf-style* `fmt` *and the following arguments and place it as hexadecimal string into* `out`*.*

*The ideal length of* `out` *would be wget\_hash\_get\_len(type) \* 2 + 1.*

## Author

*Generated automatically by Doxygen for wget2 from the source code.*
