// 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'; import { Hash } from '../model/hash'; export class EncryptOAEPBytesRequest { bb: flatbuffers.ByteBuffer|null = null; bb_pos = 0; __init(i:number, bb:flatbuffers.ByteBuffer):EncryptOAEPBytesRequest { this.bb_pos = i; this.bb = bb; return this; } static getRootAsEncryptOAEPBytesRequest(bb:flatbuffers.ByteBuffer, obj?:EncryptOAEPBytesRequest):EncryptOAEPBytesRequest { return (obj || new EncryptOAEPBytesRequest()).__init(bb.readInt32(bb.position()) + bb.position(), bb); } static getSizePrefixedRootAsEncryptOAEPBytesRequest(bb:flatbuffers.ByteBuffer, obj?:EncryptOAEPBytesRequest):EncryptOAEPBytesRequest { bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH); return (obj || new EncryptOAEPBytesRequest()).__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; } label():string|null label(optionalEncoding:flatbuffers.Encoding):string|Uint8Array|null label(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; } hash():Hash { const offset = this.bb!.__offset(this.bb_pos, 8); return offset ? this.bb!.readInt32(this.bb_pos + offset) : Hash.MD5; } mutate_hash(value:Hash):boolean { const offset = this.bb!.__offset(this.bb_pos, 8); if (offset === 0) { return false; } this.bb!.writeInt32(this.bb_pos + offset, value); return true; } publicKey():string|null publicKey(optionalEncoding:flatbuffers.Encoding):string|Uint8Array|null publicKey(optionalEncoding?:any):string|Uint8Array|null { const offset = this.bb!.__offset(this.bb_pos, 10); return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null; } static startEncryptOAEPBytesRequest(builder:flatbuffers.Builder) { builder.startObject(4); } 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 addLabel(builder:flatbuffers.Builder, labelOffset:flatbuffers.Offset) { builder.addFieldOffset(1, labelOffset, 0); } static addHash(builder:flatbuffers.Builder, hash:Hash) { builder.addFieldInt32(2, hash, Hash.MD5); } static addPublicKey(builder:flatbuffers.Builder, publicKeyOffset:flatbuffers.Offset) { builder.addFieldOffset(3, publicKeyOffset, 0); } static endEncryptOAEPBytesRequest(builder:flatbuffers.Builder):flatbuffers.Offset { const offset = builder.endObject(); return offset; } static createEncryptOAEPBytesRequest(builder:flatbuffers.Builder, messageOffset:flatbuffers.Offset, labelOffset:flatbuffers.Offset, hash:Hash, publicKeyOffset:flatbuffers.Offset):flatbuffers.Offset { EncryptOAEPBytesRequest.startEncryptOAEPBytesRequest(builder); EncryptOAEPBytesRequest.addMessage(builder, messageOffset); EncryptOAEPBytesRequest.addLabel(builder, labelOffset); EncryptOAEPBytesRequest.addHash(builder, hash); EncryptOAEPBytesRequest.addPublicKey(builder, publicKeyOffset); return EncryptOAEPBytesRequest.endEncryptOAEPBytesRequest(builder); } }