P2P Media Loader Documentation
    Preparing search index...

    Function computeInfoHash

    • Computes the infohash announced to trackers for the given stream swarm ID.

      A BitTorrent tracker infoHash MUST be exactly 20 bytes. We take 15 bytes of the binary SHA-1 and encode it to Base64. This produces exactly a 20-character ASCII string (no padding). Note: this is a 20-byte ASCII representation, not a standard 20-byte binary SHA-1 infoHash.

      This function is environment-agnostic: use it on a server (Node.js 16+) to compute the infohashes to allowlist on a private tracker.

      Parameters

      • streamSwarmId: string

      Returns string