Discover Packages
github.com/jhelison/go-torrent
marshallers
handshake
package
Version:
v1.2.0
Opens a new window with list of versions in this module.
Published: Dec 31, 2023
License: MIT
Opens a new window with license information.
Imports: 2
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
Documentation
¶
Each handshake if formed by:
- Pstr: A string identifier
- InfoHash Sha1 for the meta info
- PeerID: Unique identifier
NewHandshake creates a new handshake
Unmarshal reads a buffer and turn it into a handshake response
It doesn't the inverse from the marshal function
func (Handshake) Marshal ¶
Marshal is the serialization for the handshake
It's formed by:
- The len of the protocol ID
- The protocol ID
- Eight reserved bytes (all turned to zero, used for extensions)
- The infoHash
- The peer ID
Source Files
¶
Click to show internal directories.
Click to hide internal directories.