Skip to content

It seems incorrect base62 encoding output #175

@hongweipeng

Description

@hongweipeng
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/go-encoding@v1.0.2007/base62 output is the same with pybase62.

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

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