-
Notifications
You must be signed in to change notification settings - Fork 19
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
Which base62 algorithm does this implement? #29
Comments
Have not heard of glowfall before. This library implements mathematical byte by byte base conversion of arbitrary data. There is really only one way to do it. Standards such as base85 which has extra rules for compressing spaces etc are not pure base conversions. By default this library uses |
I think I was mistaken. The GMP, GnuPG, and Saltpack implementations seem to be the most recognized. Would you mind giving example output for your implementation compared to these references? Raw : "Hello, 世界"
Base64: SGVsbG8sIOS4lueVjA (18 chars)
Base62: 1wJfrzvdbuFbL65vcS (18 chars)
Raw : "Hello World"
Base64: SGVsbG8gV29ybGQ (15 chars)
Base62: 73XpUgyMwkGr29M (15 chars)
Raw : [ 0, 0, 0, 0, 255, 255, 255, 255 ]
Base64: AAAAAP____8 (11 chars)
Base62: 000004gfFC3 (11 chars)
Raw : [ 255, 255, 255, 255, 0, 0, 0, 0 ]
Base64: _____wAAAAA (11 chars)
Base62: LygHZwPV2MC (11 chars)
|
I too am having issues with this. Went though a bunch of go libraries implementing base62:
|
Does not match what exactly? |
@coolaj86 I can see there is a difference in number of leading zeroes in
|
@tuupola I tried decoding an output encoded with this library and couldn't get it to match original data. Fortunately, found a library that successfully decodes data encoded with your library! 🎉 https://github.com/deatil/go-encoding/blob/30f6f00c7215fcc36f3969458254e4287b3da000/base62/base62.go |
@rauanmayemir If you use a go library with different character set, you could also use the https://github.com/tuupola/base62?tab=readme-ov-file#character-sets |
@tuupola I get it, but encoded data originated from this library, so I can't go back. Even after setting characters, most libraries in Go doesn't return expected result. I'm just glad I found one implementation that matches. |
My understanding is that there is no formal spec for base62, but that the "glowfall" implementation (despite its lack of stars) has become the de facto implementation (used the most across the most repos).
Does this follow that spec? Or a different one? Or create a new one?
The text was updated successfully, but these errors were encountered: