Closed ElfSundae closed 6 years ago
Adding helper functions for different possible encodings is unnecessary. The example you posted is short and concise.
Base62::encode(hex2bin($hex));
Then for hex there are two unnecessary convert ?
https://github.com/tuupola/base62/blob/master/src/Base62/GmpEncoder.php#L36
That is lesser evil than having convenience method for each numerical system.
OK.
I think it is better to add
encodeHex
anddecodeHex
methods, then we can encode hex directly likeBase62::encodeHex($hex)
. And for internal, we may callencodeHex
for string encoding like: