Skip to content

hash, crypto: add WriteByte, WriteString method to hash implementations #38776

Description

@geraldss

This proposal was initially for embedding io.ByteWriter in hash.Hash, or adding a WriteByte() method with the same signature.

This method is already added in the new maphash.Hash. Adding it elsewhere will extend the benefits in performance and usability to the other Hash implementations.

Per feedback of @ianlancetaylor below, I'm instead proposing the addition WriteByte() from io.ByteWriter to the standard library hash.Hash implementations, including:

adler32
crc32
crc64
fnv

Metadata

Metadata

Assignees

Type

No type

Projects

Status
Accepted

Relationships

None yet

Development

No branches or pull requests

Issue actions