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

It seems incorrect base62 encoding output #175

Open
hongweipeng opened this issue Nov 14, 2024 · 0 comments
Open

It seems incorrect base62 encoding output #175

hongweipeng opened this issue Nov 14, 2024 · 0 comments

Comments

@hongweipeng
Copy link

package main
import (
	"fmt"
	"github.com/keys-pub/keys/encoding"
)
func main() {
	s := "333333333333333333333333333333333333333"
	fmt.Println(encoding.EncodeBase62([]byte(s)))
}

output:

C8kNLmvQosVnpfP6xFu76YQT4FcekMNddCwcN4zE6lP140IrxX8dP

but in pybase62 : https://pypi.org/project/pybase62/

Python 3.8.18 (default, Oct 12 2024, 13:37:44) 
[GCC 11.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import base62
>>> base62.encodebytes('333333333333333333333333333333333333333'.encode())
'12crJoybWfE2zqqnxPeYnbDOEcx8Lkv7ksPxzAA8kmM5Yb25Eb6bD'

another go library https://pkg.go.dev/github.com/deatil/[email protected]/base62 output is the same with pybase62.

Therefore, I suspect that the output of keys-pub/keys/encoding library is incorrect.

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

1 participant