Giter Club home page Giter Club logo

bencodr's People

Contributors

blatyo avatar etehtsea avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

quaternion tarang

bencodr's Issues

Unicode string length in ruby 1.9

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.

Specific torrent ::DecodeError

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.

too big number for repeat range

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?

Floats are silently rounded to integers

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.