Skip to content

What's going on with murmur3? #135

Open
@warpfork

Description

@warpfork

This code looks an awful lot like it's doing a murmur3-32, and returning four bytes:

go-multihash/sum.go

Lines 146 to 154 in 6f1ea18

func sumMURMUR3(data []byte, length int) ([]byte, error) {
number := murmur3.Sum32(data)
bytes := make([]byte, 4)
for i := range bytes {
bytes[i] = byte(number & 0xff)
number >>= 8
}
return bytes, nil
}

And this code looks an awful lot like it's registering the above code as murmur3-128, which I suspect ought to return more than four bytes:

RegisterHashFunc(MURMUR3_128, sumMURMUR3)

Should I be worried?

And if this is a bug, how comfortable are we about fixing it vs potentially breaking things that rely on the current behavior?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions