Skip to content
This repository was archived by the owner on Sep 9, 2024. It is now read-only.

toString(16) method is not a fixed length #21

@aliqandil

Description

@aliqandil

Well it's a pretty self explainetory issue, when the hash has leading zeros, it'll be omitted.
And that's something you'll never see in the output hash of any other algorithm, like sha256.
Just to make sure, I did check the python implementation of xxh64 and it also keeps the leading zeroes.

For example for XXH64......toString(16) this is the fix I used:
if( hash.length < 16 ) hash = '0'.repeat( 16 - hash.length ) + hash

Hope it helps, and thanks :)

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