(data: Buffer)
| 76 | return this._encode(0x13, Buffer.from(data)); |
| 77 | } |
| 78 | static encodeBitString(data: Buffer): Buffer { |
| 79 | // The first byte of the content is the number of unused bits at the end |
| 80 | const unusedBits = 0; // Assuming all bits are used |
| 81 | const content = Buffer.concat([Buffer.from([unusedBits]), data]); |
| 82 | return this._encode(0x03, content); |
| 83 | } |
| 84 | static encodeDate(date: Date): Buffer { |
| 85 | const year = date.getUTCFullYear(); |
| 86 | const isGeneralizedTime = year >= 2050; |
no test coverage detected