Server IP : 80.87.202.40 / Your IP : 216.73.216.169 Web Server : Apache System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64 User : bitrix ( 600) PHP Version : 8.2.27 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /opt/push-server/lib/ |
Upload File : |
class Channel { /** * * @param {Buffer} privateId * @param {?Buffer} publicId */ constructor(privateId, publicId) { /** * * @type {Buffer} */ this.privateId = privateId; /** * * @type {?Buffer} */ this.publicId = Buffer.isBuffer(publicId) ? publicId : null; /** * * @type {?String} */ this.hexPrivateId = null; this.hexPublicId = null; } getPrivateId() { return this.privateId; } getHexPrivateId() { if (this.hexPrivateId === null) { this.hexPrivateId = this.privateId.toString("hex"); } return this.hexPrivateId; } getPublicId() { return this.publicId; } getHexPublicId() { if (this.hexPublicId === null) { this.hexPublicId = this.publicId.toString("hex"); } return this.hexPublicId; } static isValid(id) { return Buffer.isBuffer(id) && id.length === 16; } } module.exports = Channel;