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

TypeError: Cannot read property 'charCodeAt' of undefined #34

Closed
wellcaffeinated opened this issue May 3, 2017 · 5 comments
Closed

Comments

@wellcaffeinated
Copy link

wellcaffeinated commented May 3, 2017

TypeError: Cannot read property 'charCodeAt' of undefined
19:37:38 dev.1 | at Hashids._encode (/node_modules/hashids/dist/hashids.js:251:45)
19:37:38 dev.1 | at Hashids._decode (/node_modules/hashids/dist/hashids.js:312:15)
19:37:38 dev.1 | at Hashids.decode (/node_modules/hashids/dist/hashids.js:184:17)

The hash happens to be "ypqyiyp", and contains one letter that isn't in the allowed character library. I'm not sure why I'm getting this error. It's just failing instead of returning null. Please advise

@jd327
Copy link
Collaborator

jd327 commented May 6, 2017

Can you post a sample w/ constructor params? If salt is private, you can send me an email.

@wellcaffeinated
Copy link
Author

I'll send you an email with the info.

@shushenghong
Copy link

same problem.

var userHashIds = new Hashids( "key-user", 5, 'abcdefghijklmnopqrstuvwxyz1234567890' ); var ids = userHashIds.decode( "as-buy7-kk" );

jd327 pushed a commit that referenced this issue Nov 5, 2017
@jd327
Copy link
Collaborator

jd327 commented Nov 5, 2017

Pushed 1.1.4. Could you guys give it a shot?

@jd327
Copy link
Collaborator

jd327 commented Nov 6, 2017

Closing. Re-open with constructor params + sample decode id, if issues.

@jd327 jd327 closed this as completed Nov 6, 2017
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

No branches or pull requests

3 participants