js-ipfs-unixfs
    Preparing search index...
    • Compute UTF-8 byte length of a JS string without allocation.

      Safe to assume UTF-8 because @ipld/dag-pb always encodes PBLink.Name via TextEncoder (UTF-8) and decodes via TextDecoder (UTF-8). This produces the same result as textEncoder.encode(str).length without the Uint8Array allocation on every put() call.

      Parameters

      • str: string

      Returns number