generateFingerprint

fun generateFingerprint(clientTag: String, major: Int, minor: Int = 0, tiny: Int = 0, tag: Int = 0): String

Build an 8-character client fingerprint string in libtorrent's Azureus style, porting generate_fingerprint(std::string name, int major, int minor, int revision, int tag).

Return

the "-XXmmtt-" style 8-character prefix.

Parameters

clientTag

the two-character client identifier (e.g. "KT", "LT"). libtorrent requires exactly two characters; if fewer than two are given it substitutes "--" (matching if (name.size() < 2) name = "--"). More than two characters is a precondition violation upstream. We require exactly two (after the short-string fallback) to avoid silently truncating.

major

major version, encoded by versionToChar into slot 3.

minor

minor version, encoded into slot 4. Defaults to 0.

tiny

revision version (libtorrent's revision), slot 5. Defaults to 0.

tag

build/tag version, slot 6. Defaults to 0.