Closed RangerMauve closed 5 years ago
I was thinking that if you try to send a buffer channel like an hypercore key, the concatenation between that and the prefix is not going to be great because the buffer by default stringify to utf8 and usually we stringify the keys to hex.
It's going to be something like: 'prefix�߯����U@D���'��f�����U�7�|�'
Maybe it doesn't matter, I don't know haha
Or we can work everything as buffer by default we can check the prefix and the channel using Buffer.isBuffer
@tinchoz49 Yeah, I added the toString('hex")
for when it's an object, it should lead to readable channel names, I think.
Discovery-channel accepts either strings or buffers and converts them to a buffer internally. I think that with the way signalhub is set up it makes more sense to convert buffers to hex strings.
So in that case I think we are good to merge this
I haven't tested it yet. I'm working on discovery-swarm-web so I'll test it as part of that before merging if that works for you. :D
Seems to be working. :)
Ok ok, NOW it's good to merge. :P
Closing in favor of the new implementation
leave()
method from discovery-swarmjoin()
for the same channel more than once to be the same as discovery-channel (do nothing)I haven't tested it yet, but this is definitely a breaking change. :P