Files
NapCatQQ/.pnpm-store/v3/files/45/0a7e37d0e278c64fc41855d5a29ba209cc4cd483fabeea754639f63bd9df81e277217c8c98d1c6e411223d7af18d24f212d46a37e61df326b780a507c10604
T
TanTan e311ca3275
Build NapCat Artifacts / Windows Loader Test (push) Canceled after 0s
Build NapCat Artifacts / Type Check & Test (push) Canceled after 0s
Build NapCat Artifacts / Build NapCat.Framework (push) Canceled after 0s
Build NapCat Artifacts / Build NapCat.Shell (push) Canceled after 0s
docs: 仓库链接指向本镜像仓库
2026-11-13 09:25:58 +08:00

44 lines
1.3 KiB
Plaintext

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.OctetString = void 0;
const asn1js = require("asn1js");
const pvtsutils_1 = require("pvtsutils");
class OctetString {
get byteLength() {
return this.buffer.byteLength;
}
get byteOffset() {
return 0;
}
constructor(param) {
if (typeof param === "number") {
this.buffer = new ArrayBuffer(param);
}
else {
if (pvtsutils_1.BufferSourceConverter.isBufferSource(param)) {
this.buffer = pvtsutils_1.BufferSourceConverter.toArrayBuffer(param);
}
else if (Array.isArray(param)) {
this.buffer = new Uint8Array(param);
}
else {
this.buffer = new ArrayBuffer(0);
}
}
}
fromASN(asn) {
if (!(asn instanceof asn1js.OctetString)) {
throw new TypeError("Argument 'asn' is not instance of ASN.1 OctetString");
}
this.buffer = asn.valueBlock.valueHex;
return this;
}
toASN() {
return new asn1js.OctetString({ valueHex: this.buffer });
}
toSchema(name) {
return new asn1js.OctetString({ name });
}
}
exports.OctetString = OctetString;