base62
base62 copied to clipboard
Error checking in decoder
Hello!
Currently there is no error checking in decoder, e.g. in DecodeToInt64():
idx = strings.IndexRune(e.encode, v)
...
c = int64(idx) * ...
strings.IndexRune() could return -1 here.
Would you accept a pull request that adds error checking?
What approach would you prefer?
panic()on error;- change return type from
int64toint64, error(this will break API); - add new function with
int64, errorreturn type?