blatyo / bencodr Goto Github PK
View Code? Open in Web Editor NEWThis gem provides a way to encode and parse bencodings used by the Bit Torrent protocol.
Home Page: http://blatyo.github.com/bencodr
License: MIT License
This gem provides a way to encode and parse bencodings used by the Bit Torrent protocol.
Home Page: http://blatyo.github.com/bencodr
License: MIT License
In ruby 1.9 length of utf-8 string is equal to the number of characters, not the number of bytes. Non-ASCII characters are encoded 2-6 bytes. For fix replace "length" to "bytesize" in file "bencodr/lib/bencodr/string.rb" line 14:
[string.length, ':', string].join
replace to:
[string.bytesize, ':', string].join
String#bytesize is works in ruby 1.8 and 1.9.
Hello,
I've been working with bencodr for some weeks parsing and re-encoding 15.000 torrent files for a specific project.
However, one torrent file - just one - gives me a
BEncode::DecodeError: BEncode::DecodeError
decode.rb:46:in `bdecode'
It is a correctly encoded torrent file because I can open it with other torrent applications, such as Transmission.
I could not fix the bencodr by myself but I think this file is a good case for make this lib 100%, after being considered stable for years.
The "special" torrent file is uploaded to http://extrapolo.com/download/7305.torrent
I appreciate any help.
Sometimes with torrents I get this error
too big number for repeat range: /.{133400}/m
~/.rvm/gems/ruby-1.9.3-p125/gems/bencodr-3.0.1/lib/bencodr/parser.rb:40:in `parse_string'
How would I be able to solve this?
Bencdr.decode Bencodr.bencode(3.1415) == 3
This conversion happens silently, which makes it a bit dangerous, because people will not know that it happens, and with some data this will create issues.
It would be great if not having float support could be added to the documentation. Also, maybe throwing an error instead of silently rounding is better behaviour in cases like this.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.