Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Consider using BigInt for the bencode integer token #18

Open
josecelano opened this issue Dec 4, 2024 · 0 comments
Open

Consider using BigInt for the bencode integer token #18

josecelano opened this issue Dec 4, 2024 · 0 comments

Comments

@josecelano
Copy link
Member

Relates to: #12 (comment)

In the new tokenizer, I decided:

  • To use only byte vectors for integer and string tokens.
  • Not to limit the size of the integer.

I wanted to keep this first tokenizer version as simple as possible, but we can discuss other @da2ce7's proposals like:

#[derive(Debug)]
pub enum Bencode<'a, R: BufRead + 'a> {
    Integer(BigInt),
    ByteString(Vec<u8>),
    List(BencodeListIterator<'a, R>),
    Dictionary(BencodeDictIterator<'a, R>),
}
  • The implementation limits the Integer to 1024bit.
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant