Skip to content

AIDC Toolkit / Utility / IdentityTransformer

Class: IdentityTransformer

Defined in: transformer.ts:289

Identity transformer. Values are transformed to themselves.

Extends

Constructors

Constructor

new IdentityTransformer(domain): IdentityTransformer

Defined in: transformer.ts:69

Constructor.

Parameters

domain

Domain.

number | bigint

Returns

IdentityTransformer

Inherited from

Transformer.constructor

Accessors

domain

Get Signature

get domain(): bigint

Defined in: transformer.ts:119

Get the domain.

Returns

bigint

Inherited from

Transformer.domain

Methods

get()

static get(domain, tweak?): Transformer

Defined in: transformer.ts:94

Get a transformer, constructing it if necessary. The type returned is IdentityTransformer if tweak is undefined, EncryptionTransformer if tweak is defined. Note that although an EncryptionTransformer with a zero tweak operates as an IdentityTransformer, EncryptionTransformer is still the type returned if a zero tweak is explicitly specified.

Parameters

domain

Domain.

number | bigint

tweak?

Tweak.

number | bigint

Returns

Transformer

IdentityTransformer if tweak is undefined, EncryptionTransformer if tweak is defined.

Inherited from

Transformer.get


doForward()

protected doForward(value): bigint

Defined in: transformer.ts:293

Do the work of transforming a value forward.

Parameters

value

bigint

Value.

Returns

bigint

Transformed value.

Overrides

Transformer.doForward


doReverse()

protected doReverse(transformedValue): bigint

Defined in: transformer.ts:300

Do the work of transforming a value in reverse.

Parameters

transformedValue

bigint

Transformed value.

Returns

bigint

Value.

Overrides

Transformer.doReverse


forward()

Call Signature

forward<TTransformerInput>(valueOrValues): TransformerOutput<TTransformerInput, bigint>

Defined in: transformer.ts:204

Transform value(s) forward.

Type Parameters
TTransformerInput

TTransformerInput extends TransformerInput<number | bigint>

Value(s) input type.

Parameters
valueOrValues

TTransformerInput

Value(s). If this is an instance of Sequence, the minimum and maximum values are validated prior to transformation. Otherwise, the individual value(s) is/are validated at the time of transformation.

Returns

TransformerOutput<TTransformerInput, bigint>

Transformed value(s).

Inherited from

Transformer.forward

Call Signature

forward<TTransformerInput, TOutput>(valueOrValues, transformerCallback): TransformerOutput<TTransformerInput, TOutput>

Defined in: transformer.ts:225

Transform value(s) forward, optionally applying a transformation.

Type Parameters
TTransformerInput

TTransformerInput extends TransformerInput<number | bigint>

Value(s) input type.

TOutput

TOutput

Transformation callback output type.

Parameters
valueOrValues

TTransformerInput

Value(s). If this is an instance of Sequence, the minimum and maximum values are validated prior to transformation. Otherwise, the individual value(s) is/are validated at the time of transformation.

transformerCallback

IndexedCallback<bigint, TOutput>

Called after each value is transformed to convert it to its final value.

Returns

TransformerOutput<TTransformerInput, TOutput>

Transformed value(s).

Inherited from

Transformer.forward


reverse()

reverse(transformedValue): bigint

Defined in: transformer.ts:277

Transform a value in reverse.

Parameters

transformedValue

Transformed value.

number | bigint

Returns

bigint

Value.

Inherited from

Transformer.reverse