GithubHelp home page GithubHelp logo

Comments (4)

resession avatar resession commented on June 7, 2024

this error is stemming from updates that has been made to https://github.com/webtorrent/node-bencode

from bittorrent-dht.

ThaUnknown avatar ThaUnknown commented on June 7, 2024

this is an issue caused by ed25519-supercop not DHT?...

from bittorrent-dht.

resession avatar resession commented on June 7, 2024

this is an issue caused by ed25519-supercop not DHT?...

yes but it is because ed25519-supercop expects either a string or buffer, but bittorrent-dht/bencode.encode() is returning a Uint8Array

https://github.com/webtorrent/bittorrent-dht/blob/master/client.js#L781C22-L781C22

check index.js, line 28
https://www.npmjs.com/package/ed25519-supercop?activeTab=code

  else if (!Buffer.isBuffer(message)) {
    throw new Error('message must be a buffer or a string')
  }

its throwing the error because bittorrent-dht/bencode is returning a Uint8Array, Buffer.from(Uint8Array) fixes it

from bittorrent-dht.

ThaUnknown avatar ThaUnknown commented on June 7, 2024

once again, this should be fixed on ed25519-supercop's end, not bittorrent-dht's end, or you can simply wrap ed25519 using buffer.from like you said

uint8array is a perfectly valid way of storing uint8 data, and unlike buffer it's cross env compatible, and as we plan on implementing DHT in web one day, Buffer would end up being removed anyways

from bittorrent-dht.

Related Issues (20)

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.