---
title: Insecure.MD5
framework: cryptokit
role: symbol
role_heading: Structure
path: cryptokit/insecure/md5
---

# Insecure.MD5

An implementation of MD5 hashing.

## Declaration

```swift
struct MD5
```

## Overview

Overview The Insecure.MD5 hash implements the HashFunction protocol to produce an MD5 digest (Insecure.MD5Digest). 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.MD5.Digest](cryptokit/insecure/md5/digest.md)
- [Insecure.MD5Digest](cryptokit/insecure/md5digest.md)

### Reporting the hash length

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

### Computing a hash iteratively

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

### Reporting hash function information

- [blockByteCount](cryptokit/insecure/md5/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.SHA1](cryptokit/insecure/sha1.md)
