-
-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathencrypt-pkcs1v15-bytes-request.ts
82 lines (66 loc) · 3.21 KB
/
encrypt-pkcs1v15-bytes-request.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
// automatically generated by the FlatBuffers compiler, do not modify
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
import * as flatbuffers from 'flatbuffers';
export class EncryptPKCS1v15BytesRequest {
bb: flatbuffers.ByteBuffer|null = null;
bb_pos = 0;
__init(i:number, bb:flatbuffers.ByteBuffer):EncryptPKCS1v15BytesRequest {
this.bb_pos = i;
this.bb = bb;
return this;
}
static getRootAsEncryptPKCS1v15BytesRequest(bb:flatbuffers.ByteBuffer, obj?:EncryptPKCS1v15BytesRequest):EncryptPKCS1v15BytesRequest {
return (obj || new EncryptPKCS1v15BytesRequest()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
}
static getSizePrefixedRootAsEncryptPKCS1v15BytesRequest(bb:flatbuffers.ByteBuffer, obj?:EncryptPKCS1v15BytesRequest):EncryptPKCS1v15BytesRequest {
bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
return (obj || new EncryptPKCS1v15BytesRequest()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
}
message(index: number):number|null {
const offset = this.bb!.__offset(this.bb_pos, 4);
return offset ? this.bb!.readUint8(this.bb!.__vector(this.bb_pos + offset) + index) : 0;
}
messageLength():number {
const offset = this.bb!.__offset(this.bb_pos, 4);
return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
}
messageArray():Uint8Array|null {
const offset = this.bb!.__offset(this.bb_pos, 4);
return offset ? new Uint8Array(this.bb!.bytes().buffer, this.bb!.bytes().byteOffset + this.bb!.__vector(this.bb_pos + offset), this.bb!.__vector_len(this.bb_pos + offset)) : null;
}
publicKey():string|null
publicKey(optionalEncoding:flatbuffers.Encoding):string|Uint8Array|null
publicKey(optionalEncoding?:any):string|Uint8Array|null {
const offset = this.bb!.__offset(this.bb_pos, 6);
return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;
}
static startEncryptPKCS1v15BytesRequest(builder:flatbuffers.Builder) {
builder.startObject(2);
}
static addMessage(builder:flatbuffers.Builder, messageOffset:flatbuffers.Offset) {
builder.addFieldOffset(0, messageOffset, 0);
}
static createMessageVector(builder:flatbuffers.Builder, data:number[]|Uint8Array):flatbuffers.Offset {
builder.startVector(1, data.length, 1);
for (let i = data.length - 1; i >= 0; i--) {
builder.addInt8(data[i]!);
}
return builder.endVector();
}
static startMessageVector(builder:flatbuffers.Builder, numElems:number) {
builder.startVector(1, numElems, 1);
}
static addPublicKey(builder:flatbuffers.Builder, publicKeyOffset:flatbuffers.Offset) {
builder.addFieldOffset(1, publicKeyOffset, 0);
}
static endEncryptPKCS1v15BytesRequest(builder:flatbuffers.Builder):flatbuffers.Offset {
const offset = builder.endObject();
return offset;
}
static createEncryptPKCS1v15BytesRequest(builder:flatbuffers.Builder, messageOffset:flatbuffers.Offset, publicKeyOffset:flatbuffers.Offset):flatbuffers.Offset {
EncryptPKCS1v15BytesRequest.startEncryptPKCS1v15BytesRequest(builder);
EncryptPKCS1v15BytesRequest.addMessage(builder, messageOffset);
EncryptPKCS1v15BytesRequest.addPublicKey(builder, publicKeyOffset);
return EncryptPKCS1v15BytesRequest.endEncryptPKCS1v15BytesRequest(builder);
}
}