![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
magnet-uri-js
Advanced tools
Library to convert Magnet URIS to objects
npm install magnet-uri-js
const magneturi = require('magnet-uri-js');
const obj = {
'xt':
[ 'urn:ed2k:354B15E68FB8F36D7CD88FF94116CDC1',
'urn:tree:tiger:7N5OAMRNGMSSEUE3ORHOKWN4WWIQ5X4EBOOTLJY',
'urn:btih:QHQXPYWMACKDWKP47RRVIV7VOURXFE5Q'
],
'xl': '10826029',
'dn': 'mediawiki-1.15.1.tar.gz',
'tr': 'udp://tracker.openbittorrent.com:80/announce',
'as': 'http://download.wikimedia.org/mediawiki/1.15/mediawiki-1.15.1.tar.gz',
'xs':
[ 'http://cache.example.org/XRX2PEFXOOEJFRVUCX6HMZMKS5TWG4K5',
'dchub://example.org'
]
};
const uri = magneturi.encode(obj);
magnet:?xt=urn:ed2k:354B15E68FB8F36D7CD88FF94116CDC1&xt=urn:tree:tiger:7N5OAMRNGMSSEUE3ORHOKWN4WWIQ5X4EBOOTLJY&xt=urn:btih:QHQXPYWMACKDWKP47RRVIV7VOURXFE5Q&xl=10826029&dn=mediawiki-1.15.1.tar.gz&tr=udp%3A%2F%2Ftracker.openbittorrent.com%3A80%2Fannounce&as=http%3A%2F%2Fdownload.wikimedia.org%2Fmediawiki%2F1.15%2Fmediawiki-1.15.1.tar.gz&xs=http%3A%2F%2Fcache.example.org%2FXRX2PEFXOOEJFRVUCX6HMZMKS5TWG4K5&xs=dchub%3A%2F%2Fexample.org
const obj = {
'xt':[
'urn:sha1:YNCKHTQCWBTRNJIV4WNAE52SJUQCZO5C',
'urn:sha1:TXGCZQTH26NL6OUQAJJPFALHG2LTGBC7'
]
};
const uri = magneturi.encode(obj, true);
magnet:?xt.1=urn:sha1:YNCKHTQCWBTRNJIV4WNAE52SJUQCZO5C&xt.2=urn:sha1:TXGCZQTH26NL6OUQAJJPFALHG2LTGBC7
const uri = 'magnet:?xt=urn:ed2k:31D6CFE0D16AE931B73C59D7E0C089C0&xl=0&dn=zero_len.fil&xt=urn:bitprint:3I42H3S6NNFQ2MSVX7XZKYAYSCX5QBYJ.LWPNACQDBZRYXW3VHJVCJ64QBZNGHOHHHZWCLNQ&xt=urn:md5:D41D8CD98F00B204E9800998ECF8427E';
const obj = magneturi.decode(uri);
{ xt:
[ 'urn:ed2k:31D6CFE0D16AE931B73C59D7E0C089C0',
'urn:bitprint:3I42H3S6NNFQ2MSVX7XZKYAYSCX5QBYJ.LWPNACQDBZRYXW3VHJVCJ64QBZNGHOHHHZWCLNQ ',
'urn:md5:D41D8CD98F00B204E9800998ECF8427E' ],
xl: '0',
dn: 'zero_len.fil' }
String
Encodes an object as a Magnet URI
Param | Type |
---|---|
obj | Object |
multiParamIndexing | Boolean |
Object
Decodes a Magnet URI and returns an object of all its parameters.
Param | Type |
---|---|
magnet_uri | string |
FAQs
Library to convert Magnet URIS to objects
We found that magnet-uri-js demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.