Skip to content

feature request: ahash without length prefixing #198

Description

@nwalfield

In Sequoia, we currently use xxhash to compare streams. ahash appears to be better than xxhash, because, as discussed in your README, it is faster, and it is already used by our other dependencies. The problem is that ahash appears to automatically adds length prefixes.

First, perhaps I'm holding it wrong. In that case, I apologize in advance for the noise, but would appreciate any tips.

As an aside, I'm a bit confused by this note in the Rust documentation for Hasher::write:

Note to Implementers

You generally should not do length-prefixing as part of implementing this method. It’s up to the Hash implementation to call Hasher::write_length_prefix before sequences that need it.

I understand that to mean that an implementation of Hash should do length prefixing; an implementation of Hasher, like ahash's implementation should not do length prefixing, but it seems to. Is this correct?

Assuming ahash's implementation is okay, I'd like to suggest a variant that can work on streams by not doing length prefixing and not padding short writes.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions