versionToChar
Encode a single version component as one fingerprint character. This is the port of the anonymous version_to_char(int v) in src/fingerprint.cpp.
libtorrent maps 0..9 to the digits '0'..'9' and any value >= 10 to the letters 'A','B','C',... (i.e. 10 -> 'A', 35 -> 'Z'). This widens the per-slot range past a single decimal digit, base-36 style. Negative values are a precondition violation upstream (TORRENT_ASSERT_FAIL); here they throw.
Note libtorrent does not bound the upper end, so v == 36 would roll past 'Z' into '[' and beyond. We reproduce that behaviour rather than clamping, but the version slots are small in practice.