---
title: finalize()
framework: cryptokit
role: symbol
role_heading: Instance Method
path: cryptokit/hmac/finalize()
---

# finalize()

Finalizes the message authentication computation and returns the computed code.

## Declaration

```swift
func finalize() -> HMAC<H>.MAC
```

## Return Value

Return Value The message authentication code.

## See Also

### Creating an authentication code iteratively

- [init(key:)](cryptokit/hmac/init(key:).md)
- [update(data:)](cryptokit/hmac/update(data:).md)
