---
title: hash.sha1() function
description: hash.sha1() converts a string value to a hexadecimal hash using the SHA-1 hash algorithm.
url: https://docs.influxdata.com/flux/v0/stdlib/contrib/qxip/hash/sha1/
estimated_tokens: 165
product: Flux
version: v0
publisher: InfluxData
canonical: https://docs.influxdata.com/flux/v0/stdlib/contrib/qxip/hash/sha1/
date: '2024-04-08T16:01:02-06:00'
lastmod: '2024-04-08T16:01:02-06:00'
---

* Flux 0.193.0+

InfluxDB support

> [!Important]
> `hash.sha1()` is a user-contributed function maintained by
> the [package author](#package-author-and-maintainer).

`hash.sha1()` converts a string value to a hexadecimal hash using the SHA-1 hash algorithm.

##### Function type signature

```js
(v: A) => string
```

For more information, see [Function type signatures](/flux/v0/function-type-signatures/).

## Parameters

### v

(Required)
String to hash.

## Examples

### Convert a string to a SHA-1 hash

```
import "contrib/qxip/hash"

hash.sha1(
    v: "Hello, world!",
)// Returns 315f5bdb76d078c43b8ac0064e4a0164612b1fce77c869345bfc94c75894edd3

```
