---
name: "ne_strhash"
section: "3"
platform: "linux"
package: "neon"
version: "0.37.1-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/ne_strhash"
---

# ne\_strhash(3)

string hash interface

## NAME

ne\_strhash, ne\_vstrhash - string hash interface

## SYNOPSIS

```
#include <ne_string.h>
```

**char \*ne\_strhash(unsigned int** *flags***,** *...***);**

**char \*ne\_vstrhash(unsigned int** *flags***, va\_list** *ap***);**

## DESCRIPTION

The **ne\_strhash** and **ne\_vstrhash** functions can be used to create hashes. The varargs argument list must be **const char \*** strings followed by a NULL terminator. The *flags* argument must select exactly one hash algorithm from the list below, which can be optionally bitwise-ORed with one of the formatting option. The hash is calculated for the concatenation of the argument list, without separators.

### Hash algorithms

The following hash algorithms are available:

**NE\_HASH\_MD5**

MD5

**NE\_HASH\_SHA1**

SHA-1

**NE\_HASH\_SHA256**

SHA-256 (SHA-2)

**NE\_HASH\_SHA512**

SHA-512 (SHA-2)

**NE\_HASH\_SHA512\_256**

SHA-512/256 (SHA-2)

### Formatting options

By default, the hash is returned as a hexadecimal lower-case character string. The following formatting options are available:

**NE\_HASH\_COLON**

colon-separated hex pairs, e.g. "aa:11:22..."

**NE\_HASH\_SPACE**

space-separated hex pairs, e.g. "aa 11 22..."

## RETURN VALUE

The return value is the ASCII hexadecimal representation of the hash as a malloc-allocated, NUL-terminated string, or NULL if the hash cannot be created. The string length is determined by the hash algorithm (and formatting options used). Support for hash algorithms is specific to the SSL toolkit with which neon is compiled. Some systems will further restrict hash availability at runtime, e.g. due to FIPS mode.

## HISTORY

**ne\_strhash** and **ne\_vstrhash** are available in neon 0.32.0 and later.

The **NE\_HASH\_SHA1** flag is available in neon 0.37.0 and later.

## COPYRIGHT

Copyright © 2001-2026 Joe Orton\
