add public/private torrent swarms

This commit is contained in:
Jimmy Zelinskie 2015-12-31 14:27:38 -05:00
parent 4cb06525a4
commit c780572e69
2 changed files with 13 additions and 7 deletions

View file

@ -10,7 +10,10 @@ from app import app
TRACKER_ANNOUNCE_URL = app.config.get('BT_TRACKER_ANNOUNCE_URL')
NAMING_SALT = app.config.get('BT_NAMING_SALT')
def private_torrent_name(user_uuid, blob_uuid):
def public_torrent_filename(blob_uuid):
return hashlib.sha256(blob_uuid).hexdigest()
def per_user_torrent_filename(user_uuid, blob_uuid):
return hashlib.sha256(blob_uuid + user_uuid + NAMING_SALT).hexdigest()