base32: make GetEncoderFromPath more robust
Primarily, get rid of extractCidString and cidVer. Neither of these functions
did sane things when a path when a path didn't actually include a CID. For
example, "boo" would yield a base32 encoder.
Also:
* Avoid "optional" errors.
* Make it a pure function of the input path.
* Extract the multibase from *any* type of path of the form
/namespace/cid-like-thing/... This is a DWIM function.
License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
Showing
Please register or sign in to comment