Skip to content

Commit 25dee42

Browse files
committed
Update release notes for PR #99
1 parent 25ce56a commit 25dee42

2 files changed

Lines changed: 18 additions & 17 deletions

File tree

.release-notes/box-receiver-crypto-apply.md

Lines changed: 0 additions & 17 deletions
This file was deleted.

.release-notes/next-release.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,3 +207,21 @@ ctx.set_max_proto_version(SSLAutoVersion())?
207207

208208
The values and the behavior are unchanged. Rename the call sites and you are done.
209209

210+
## Require a box receiver for ssl/crypto's apply methods
211+
212+
The `apply` methods on the eight one-shot hash functions (`MD4`, `MD5`, `RIPEMD160`, `SHA1`, `SHA224`, `SHA256`, `SHA384`, `SHA512`), on `ToHexString`, `RandBytes`, `HmacSha256` and `Pbkdf2Sha256`, and on the `HashFn` interface, took a `tag` receiver. They take a `box` receiver now.
213+
214+
Calling any of them the way you normally would — `MD5("data")`, `HmacSha256(key, message)?` — needs no change. Writing your own `HashFn` needs no change either: a `fun tag apply` still satisfies the interface, and a `fun box apply`, which did not satisfy the `tag` interface before, satisfies it now too.
215+
216+
The one thing that stops compiling is a reference typed `tag`, because a `box` method cannot be called through a `tag`:
217+
218+
```pony
219+
// Was fine, now a compile error:
220+
let hash: HashFn tag = SHA256
221+
hash("data")
222+
223+
// Type the reference val (or box):
224+
let hash: HashFn val = SHA256
225+
hash("data")
226+
```
227+

0 commit comments

Comments
 (0)