UNPKG

chia-network-scanner

Version:
23 lines 695 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Peer = void 0; const crypto_1 = require("crypto"); class Peer { constructor(peerOptions) { this.visited = false; this.hostname = peerOptions.hostname; this.port = peerOptions.port; this.timestamp = peerOptions.timestamp; } visit() { this.visited = true; } hash() { return crypto_1.createHash('sha1') // Timestamp is not included as the same peer may be reported with a different timestamp .update(`${this.hostname}${this.port}`) .digest('hex'); } } exports.Peer = Peer; //# sourceMappingURL=peer.js.map