Skip to content

Conversation

qmuntal
Copy link
Collaborator

@qmuntal qmuntal commented Jan 7, 2025

Upstream will most likely define a standardized hash clone interface: golang/go#69521 (comment)

type CloneHash interface {
    hash.Hash
    Clone() hash.Hash
}

We should follow suite so that our hash types are compatible with upstream. The only difference with our current approach is that the new Clone method doesn't return an error, which makes sense given that other hash methods are not allowed to return an error. It is also unlikely that OpenSSL will return an error when duplicating a hash unless there is a programmer error or the there is no memory available in the system, in which case it makes sense to panic anyway.

Note that the current Clone methods are not yet included in a release, so this is not a breaking change.

@qmuntal qmuntal merged commit eb155da into v2 Jan 7, 2025
54 checks passed
@qmuntal qmuntal deleted the clonestd branch January 7, 2025 11:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants