Added API to use internal libtorrent to_hex function.