Class: BaseBlock<T, J>
Type parameters
Name | Type |
---|---|
T | extends ValueBlock = ValueBlock |
J | extends ValueBlockJson = ValueBlockJson |
Hierarchy
-
LocalBaseBlock
↳
BaseBlock
↳↳
Primitive
↳↳
Constructed
↳↳
EndOfContent
↳↳
Null
↳↳
Boolean
↳↳
OctetString
↳↳
BitString
↳↳
Integer
Implements
Constructors
constructor
• new BaseBlock<T
, J
>(«destructured»?
, valueBlockType?
): BaseBlock
<T
, J
>
Type parameters
Name | Type |
---|---|
T | extends ValueBlock = ValueBlock |
J | extends LocalBaseBlockJson = LocalBaseBlockJson |
Parameters
Name | Type |
---|---|
«destructured» | BaseBlockParams |
valueBlockType? | ValueBlockConstructor <T > |
Returns
BaseBlock
<T
, J
>
Overrides
LocalBaseBlock.constructor
Properties
blockLength
• blockLength: number
Inherited from
LocalBaseBlock.blockLength
error
• error: string
Inherited from
LocalBaseBlock.error
idBlock
• idBlock: LocalIdentificationBlock
lenBlock
• lenBlock: LocalLengthBlock
name
• name: string
Implementation of
optional
• optional: boolean
Implementation of
primitiveSchema
• Optional
primitiveSchema: BaseBlock
<ValueBlock
, LocalBaseBlockJson
>
Implementation of
valueBeforeDecodeView
• valueBeforeDecodeView: Uint8Array
Since
3.0.0
Inherited from
LocalBaseBlock.valueBeforeDecodeView
valueBlock
• valueBlock: T
warnings
• warnings: string
[]
Inherited from
LocalBaseBlock.warnings
NAME
▪ Static
NAME: string
= "BaseBlock"
Overrides
LocalBaseBlock.NAME
Accessors
valueBeforeDecode
• get
valueBeforeDecode(): ArrayBuffer
Returns
ArrayBuffer
Deprecated
since version 3.0.0
Inherited from
LocalBaseBlock.valueBeforeDecode
• set
valueBeforeDecode(value
): void
Parameters
Name | Type |
---|---|
value | ArrayBuffer |
Returns
void
Deprecated
since version 3.0.0
Inherited from
LocalBaseBlock.valueBeforeDecode
Methods
fromBER
▸ fromBER(inputBuffer
, inputOffset
, inputLength
): number
Base function for converting block from BER encoded array of bytes
Parameters
Name | Type | Description |
---|---|---|
inputBuffer | Uint8Array | ArrayBuffer | ASN.1 BER encoded array |
inputOffset | number | Offset in ASN.1 BER encoded array where decoding should be started |
inputLength | number | Maximum length of array of bytes which can be using in this function |
Returns
number
Offset after least decoded byte
Implementation of
isEqual
▸ isEqual(other
): other is BaseBlock<T, J>
Determines whether two object instances are equal
Parameters
Name | Type | Description |
---|---|---|
other | unknown | Object to compare with the current object |
Returns
other is BaseBlock<T, J>
onAsciiEncoding
▸ onAsciiEncoding(): string
Returns
string
toBER
▸ toBER(sizeOnly?
, writer?
): ArrayBuffer
Encoding of current ASN.1 block into ASN.1 encoded array (BER rules)
Parameters
Name | Type | Description |
---|---|---|
sizeOnly? | boolean | Flag that we need only a size of encoding, not a real array of bytes |
writer? | ViewWriter | - |
Returns
ArrayBuffer
ASN.1 BER encoded array
Implementation of
toJSON
▸ toJSON(): BaseBlockJson
<J
>
Returns
Overrides
LocalBaseBlock.toJSON
toString
▸ toString(encoding?
): string
Parameters
Name | Type | Default value |
---|---|---|
encoding | StringEncoding | "ascii" |
Returns
string
blockName
▸ blockName(): string
Aux function, need to get a block name. Need to have it here for inheritance
Returns
string
Returns name of the block
Inherited from
LocalBaseBlock.blockName