                (str "Cannot read multihash from byte array: " encoded-size
                     " is less than the minimum of " min-size)
                {:type :multihash/bad-input}))))
-  (let [code (aget encoded 0)
-        length (aget encoded 1)
+  (let [code (bytes/get-byte encoded 0)
+        length (bytes/get-byte encoded 1)
         payload (- (alength encoded) 2)]
     (when-not (pos? length)
       (throw (ex-info

        (b58/decode source))))


  InputStream

  (decode
    [source]
    (let [code (.read source)
          digest (read-stream-digest source)]
      (create code digest))))


(extend-protocol Decodable

  #?(:clj (class (byte-array 0))
     :cljs js/Uint8Array)

  (decode
    [source]
    (decode-array source))


  #?(:clj java.lang.String
     :cljs js/String)

  (decode
    [source]
