---
title: Insecure.SHA1
framework: cryptokit
role: symbol
role_heading: Structure
path: cryptokit/insecure/sha1
---

# Insecure.SHA1

An implementation of SHA1 hashing.

## Declaration

```swift
struct SHA1
```

## Overview

Overview The Insecure.SHA1 hash implements the HashFunction protocol to produce a SHA1 digest (Insecure.SHA1Digest). You can compute the digest by calling the static hash(data:) method once. Alternatively, if the data that you want to hash is too large to fit in memory, you can compute the digest iteratively by creating a new hash instance, calling the update(data:) method repeatedly with blocks of data, and then calling the finalize() method to get the result. important: This hash algorithm isn’t considered cryptographically secure, but is provided for backward compatibility with older services that require it. For new services, prefer one of the secure hashes, like SHA512.

## Topics

### Specifying the output type

- [Insecure.SHA1.Digest](cryptokit/insecure/sha1/digest.md)
- [Insecure.SHA1Digest](cryptokit/insecure/sha1digest.md)

### Reporting the hash length

- [byteCount](cryptokit/insecure/sha1/bytecount.md)

### Computing a hash iteratively

- [init()](cryptokit/insecure/sha1/init().md)
- [update(bufferPointer:)](cryptokit/insecure/sha1/update(bufferpointer:).md)
- [finalize()](cryptokit/insecure/sha1/finalize().md)

### Reporting hash function information

- [blockByteCount](cryptokit/insecure/sha1/blockbytecount.md)

## Relationships

### Conforms To

- [Copyable](swift/copyable.md)
- [Escapable](swift/escapable.md)
- [HashFunction](cryptokit/hashfunction.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Hashes

- [Insecure.MD5](cryptokit/insecure/md5.md)
