feat(p2p): file transfer p2p feature

This commit is contained in:
Alexey Kasyanchuk
2018-08-31 06:14:25 +03:00
parent 2773db3949
commit 3e6ac4c00d
3 changed files with 54 additions and 11 deletions

View File

@ -0,0 +1,8 @@
module.exports = (magnet) => {
const match = /magnet:\?xt=urn:btih:([0-9a-f]+)/i.exec(magnet)
if(!match)
return
if(match[1].length === 40)
return match[1].toLowerCase()
return
}