Skip to content

cksum: Uniformize length representation in BITS rather than BYTES #11500

@RenjiSann

Description

@RenjiSann

Currently, we store digest length for Blake2b and Blake3 in BYTES, and in BITS for other algorithms.
This is very error prone, since there are some functions in uucore::features::checksum that accept a size argument whose interpretation as bits or bytes comes from the context provided along this argument.

First line to change is the comment here:

// Note: we store Blake*'s length as BYTES.
Blake2b(usize),
Blake3(usize),

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions