-
Notifications
You must be signed in to change notification settings - Fork 110
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
Fix EncodeHex and DecodeHex from original implementations #51
base: master
Are you sure you want to change the base?
Conversation
hashids_test.go
Outdated
@@ -73,7 +73,7 @@ func TestEncodeDecodeEpoch(t *testing.T) { | |||
|
|||
func TestEncodeDecodeHex(t *testing.T) { | |||
hdata := NewData() | |||
hdata.MinLength = 30 | |||
hdata.MinLength = 8 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you change the MinLength
? What is the result if you leave it at 30? If you change the implementation, leave the unit test unchanged.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for replying. i had turn backed it to 'MinLength = 30'
and you can check it with js example in: https://codepen.io/anon/pen/arVLpG
What is the status of this? Is it going to be merged or not? Also, if it gets merged, how is it going to be released, seeing that it breaks backward compatibility? |
I propose to close this issue. |
why not release never version with go mod as /v2 ? |
Well, I think that a In addition, this "fixed" implementation of DecodeHex use a regexp, which is not efficient, so it must not be merged as is. |
Hi
in original implementation encode the hex
5a74d76ac89b05000e977baa
with saltthis is my salt
is equal withbv89jEY45DslgBOeD2Qg
. but i tested it with this repo and it's different with original implementation.i fixed it in this PR.