---
title: "update(bufferPointer:)"
framework: cryptokit
role: symbol
role_heading: Instance Method
path: "cryptokit/hashfunction/update(bufferpointer:)"
---

# update(bufferPointer:)

Incrementally updates the hash function with the contents of the buffer.

## Declaration

```swift
mutating func update(bufferPointer: UnsafeRawBufferPointer)
```

## Parameters

- `bufferPointer`: A pointer to the next block of data for the ongoing digest calculation.

## Discussion

Discussion Call this method one or more times to provide data to the hash function in blocks. After providing the last block of data, call the finalize() method to get the computed digest. Don’t call the update method again after finalizing the hash function. note: Typically, it’s safer to use an instance of Data, or some other type that conforms to the DataProtocol, to hold your data. When possible, use the update(data:) method instead.

## See Also

### Computing a hash iteratively

- [init()](cryptokit/hashfunction/init().md)
- [update(data:)](cryptokit/hashfunction/update(data:).md)
- [finalize()](cryptokit/hashfunction/finalize().md)
