Open coolaj86 opened 2 years ago
Looks like all of these must be "BaseX" implementations of Base62. It seems to match the others:
1wJfrzvdbuFbL65vcS
73XpUgyMwkGr29M
00
00000000000000000
000000000000000000000000000000000
000004gfFC3
LygHZwPV2MC
I learned a little ruby real quick to figure that out.
require 'bundler/setup'
require 'base_x'
puts BaseX::Base62DUL.encode("Hello, 世界")
puts BaseX::Base62DUL.encode("Hello World")
puts BaseX::Base62DUL.encode("\x00")
puts BaseX::Base62DUL.encode("\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00")
puts BaseX::Base62DUL.encode("\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00")
puts BaseX::Base62DUL.encode("\x00\x00\x00\x00\xff\xff\xff\xff")
puts BaseX::Base62DUL.encode("\xff\xff\xff\xff\x00\x00\x00\x00")
echo <<EOF >> Gemfile
source 'https://rubygems.org'
gem 'base_x'
EOF
bundle install --path vendor/bundle
bundle exec ruby main.rb
Which base62 implementations is this compatible with?
Reference Strings
For reference, I believe this is what base62 encoding and decoding should look like:
Reference Implementation
I generated that using https://github.com/keybase/saltpack/encoding/basex, which seems to be correct and agree with other implementations, such as https://github.com/oconnor663/basex_gmp.