webcrypto.dart icon indicating copy to clipboard operation
webcrypto.dart copied to clipboard

Consider removing `KeyPair` class in favor of a record `typedef KeyPair<T,S> = ({T privateKey, S publicKey});`

Open jonasfj opened this issue 1 year ago • 0 comments

We could do:

typedef KeyPair<T,S> = ({T privateKey, S publicKey});

Instead of having a KeyPair class, it's not like we need the class for anything, all it does is create a type that doesn't have to exist.

It would be a cleaner API t use a record.

Given that there is no public constructor for KeyPair and the fact that it is final; I'm not even sure it's really a breaking change.


Making this change is probably easy. But I think we should land it along with a breaking version bump, so 0.5.x -> 0.6.0 or something like that.

jonasfj avatar Feb 12 '25 11:02 jonasfj