Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when use salt and non-alphabet custom string #17

Open
nallwhy opened this issue Apr 23, 2023 · 1 comment · May be fixed by #18
Open

Error when use salt and non-alphabet custom string #17

nallwhy opened this issue Apr 23, 2023 · 1 comment · May be fixed by #18

Comments

@nallwhy
Copy link

nallwhy commented Apr 23, 2023

custom_string = "123456789абвгґдеєжзиіїйклмнопрстуфцчшщьюяАБВГҐДЕЄЖЗИІЇЙКЛМНОПРСТУФЦЧШЩЬЮЯ"
hashids = Hashids.new(salt: "ЦжЧєДОЄ8ук", alphabet: custom_string)

** (MatchError) no match of right hand side value: {[], []}
    (hashids 2.1.0) iex:58: Hashids.Helpers.swap/3
    (hashids 2.1.0) iex:54: Hashids.Helpers.loop/6
    (hashids 2.1.0) iex:261: Hashids.calculate_seps/4
    (hashids 2.1.0) iex:90: Hashids.new/1
    iex:53: (file)
@nallwhy
Copy link
Author

nallwhy commented Apr 23, 2023

I think at least one of seps 'cfhistuCFHISTU' need to be included in custom string.

@vonagam vonagam linked a pull request Mar 13, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant