Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

bncode

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bncode - npm Package Compare versions

Comparing version 0.5.1 to 0.5.2

7

bncode.js

@@ -381,5 +381,6 @@ /*jshint es5:false, asi:true, quotmark:false, eqeqeq:false, forin: false */

var func = function (obj, pos) {
for (var p in obj) {
var key = Bencode(p),
val = Bencode(obj[p])
var keys = Object.keys(obj).sort()
for (var i in keys) {
var key = Bencode(keys[i]),
val = Bencode(obj[keys[i]])
ensure(key.length + val.length, pos)

@@ -386,0 +387,0 @@ key.copy(buffer, pos, 0)

{
"name": "bncode",
"version": "0.5.1",
"version": "0.5.2",
"description": "bittorrent bencoding and decoding.",

@@ -5,0 +5,0 @@ "author": "Tim Becker <tim.becker@kuriositaet.de>",

@@ -79,3 +79,3 @@

return assert("src comment doc example",
"d3:bla4:blup3:foo3:bar3:onei1e4:woahd3:arrli1ei2ei3eee3:str16:Buffers work tooe",
"d3:bla4:blup3:foo3:bar3:onei1e3:str16:Buffers work too4:woahd3:arrli1ei2ei3eeee",
bencBuffer.toString())

@@ -125,2 +125,10 @@ }

assert('dict3', 'd3:bla4:blub4:blubi4ee', benc.encode({'bla':'blub', 'blub':4}).toString() )
// keys are typically enumerated in the order of creation (in JS), but should be enumerated
// alphabetically in bencoding ...
var dict = {}
dict["c"] = 1
dict["b"] = "1"
dict["a"] = 1
assert('dict4', 'd1:ai1e1:b1:11:ci1ee',benc.encode(dict).toString());

@@ -127,0 +135,0 @@ //log("assert('dict1', '"+benc.encode({}).toString()+"', benc.encode({}).toString() )")

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc