js-ipfs-unixfs
    Preparing search index...

    Function dataFieldSerializedSize

    • Exact bytes the PBNode Data field adds for a UnixFS directory.

      Directory-only: the type field is hardcoded to directory (2 bytes) and the default mode is 0o755. Do not use for file nodes (different type byte, different default mode 0o644).

      For the common case (no mode, no mtime) this is always 4 bytes: innerSize=2 [0x08,0x01], wrapper 1+1+2=4.

      Parameters

      • Optionalmode: number
      • Optionalmtime: Mtime

      Returns number