Comparing version 0.5.1 to 0.5.2
@@ -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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
127142
711
0