BenCoder
Class InfoHash

public class InfoHash

Title: InfoHash

Description: Provides the methods for Calculating Hash of the info Value of the Torrent File

Copyright: Copyright (c) 2004

Company: CSI5321

Version:
1.0
Author:
Firasath Riyaz
Constructor Detail

InfoHash

public InfoHash()
Creates a new Instance of Infohash

Method Detail

createInfoMap

private Map createInfoMap(Map metaFileMap)

Description: Takes a Map of the meta file and returns a Map containing only info Key-Value pairs

Parameters:
metaFileMap - obtained from the Torrent ( meta File )
Returns:
tempInfoMap containing the "info" Key-Value pair

getBencodedInfoMap2

private String getBencodedInfoMap2(Map infoMap)

Description: Takes a Map of info Key-Value pairs and B-encodes the info Key_Value pair

Parameters:
infoMap - of info Key-value pair
Returns:
aBencodedInfo

getInfoHash

public String getInfoHash(Map metaFileMap)

Description: Calculates the SHA1 encoding on the infoMap

Parameters:
metaFileMap - Map
Returns:
String
Throws:
IOException -
NoSuchAlgorithmException -