Skip to content

Salts longer than 42 characters are truncated #9

@langelgjm

Description

@langelgjm

After installing plpg_hashids, I do the following:

SELECT hashids.encode(1001, 'the salt goes here and has some maximum l') = hashids.encode(1001, 'the salt goes here and has some maximum le');
-- false, as expected: different salts produce different hashes

SELECT hashids.encode(1001, 'the salt goes here and has some maximum le') = hashids.encode(1001, 'the salt goes here and has some maximum len');
-- true, unexpected: different salts produce the same hash

Database version:
PostgreSQL 9.6.15 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.3 20140911 (Red Hat 4.8.3-9), 64-bit (AWS RDS)

I took a quick look through the code and didn't see anything obvious that would cause this, but will try to narrow down the cause.

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