Use Hash#key to silence Hash#index deprecation warnings

Update torrent library to use Hash#key instead of Hash#index to avoid warnings of Hash#index being deprecated.