• Steven Allen's avatar
    base32: make GetEncoderFromPath more robust · 19d8f624
    Steven Allen authored
    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: default avatarSteven Allen <steven@stebalien.com>
    19d8f624
cidbase.go 3.43 KB