AIDC Toolkit / GS1 / NonSerializableNumericIdentifierCreator
Class: NonSerializableNumericIdentifierCreator
Defined in: src/non-serializable-numeric-identifier-creator.ts:8
Non-serializable numeric identifier creator.
Extends
NonSerializableNumericIdentifierValidator<this> &NonGTINNumericIdentifierCreator<NonSerializableNumericIdentifierType,this>
Properties
create()
create: {(
value,sparse?):string; (values,sparse?):Iterable<string>; }
Defined in: src/numeric-identifier-creator.ts:29
Call Signature
(
value,sparse?):string
Create an identifier with a reference based on a numeric value. The value is converted to a reference of the appropriate length using NUMERIC_CREATOR.
Parameters
value
Numeric value.
number | bigint
sparse?
boolean
If true, the value is mapped to a sparse sequence resistant to discovery.
Returns
string
Identifier.
Call Signature
(
values,sparse?):Iterable<string>
Create identifiers with references based on numeric values. The values are converted to references of the appropriate length using NUMERIC_CREATOR.
Parameters
values
Iterable<number | bigint>
Numeric values.
sparse?
boolean
If true, the values are mapped to a sparse sequence resistant to discovery.
Returns
Iterable<string>
Identifiers.
Inherited from
MixinAbstractNonGTINNumericIdentifierCreator< NonSerializableNumericIdentifierType >(NonSerializableNumericIdentifierValidator).create
createAll()
createAll: () =>
Iterable<string>
Defined in: src/numeric-identifier-creator.ts:71
Create all identifiers for the prefix from 0 to capacity - 1.
The implementation creates the strings only as needed using an internal generator function. Although the result is equivalent to calling creator.create(new Sequence(0, creator.capacity)), this method is significantly faster.
Returns
Iterable<string>
All identifiers for the prefix.
Inherited from
MixinAbstractNonGTINNumericIdentifierCreator< NonSerializableNumericIdentifierType >(NonSerializableNumericIdentifierValidator).createAll
Constructors
Constructor
abstractnew NonSerializableNumericIdentifierCreator(...args):NonSerializableNumericIdentifierCreator
Defined in: node_modules/@aidc-toolkit/core/dist/index.d.ts:40
Parameters
args
[PrefixProvider, "GLN"] | [PrefixProvider, "SSCC"] | [PrefixProvider, "GSRN"] | [PrefixProvider, "GSIN"]
Returns
NonSerializableNumericIdentifierCreator
Inherited from
MixinAbstractNonGTINNumericIdentifierCreator< NonSerializableNumericIdentifierType >(NonSerializableNumericIdentifierValidator).constructor
Accessors
leaderType
Get Signature
get leaderType():
IdentifierTypeDescriptor<TNumericIdentifierType>["leaderType"]
Defined in: src/numeric-identifier-validator.ts:52
Inherit Doc
Returns
IdentifierTypeDescriptor<TNumericIdentifierType>["leaderType"]
Inherited from
MixinAbstractNonGTINNumericIdentifierCreator< NonSerializableNumericIdentifierType >(NonSerializableNumericIdentifierValidator).leaderType
identifierType
Get Signature
get identifierType():
IdentifierTypeDescriptor<TIdentifierType>["identifierType"]
Defined in: src/identifier-validator.ts:65
Get the identifier type. Per the GS1 General Specifications, the identifier type determines the remaining properties.
Returns
IdentifierTypeDescriptor<TIdentifierType>["identifierType"]
Inherited from
MixinAbstractNonGTINNumericIdentifierCreator< NonSerializableNumericIdentifierType >(NonSerializableNumericIdentifierValidator).identifierType
prefixType
Get Signature
get prefixType():
IdentifierTypeDescriptor<TIdentifierType>["prefixType"]
Defined in: src/identifier-validator.ts:73
Get the prefix type supported by the identifier type. For all identifier types except the GTIN, this is a GS1 Company Prefix. For the GTIN, the prefix type determines the length.
Returns
IdentifierTypeDescriptor<TIdentifierType>["prefixType"]
Inherited from
MixinAbstractNonGTINNumericIdentifierCreator< NonSerializableNumericIdentifierType >(NonSerializableNumericIdentifierValidator).prefixType
length
Get Signature
get length():
IdentifierTypeDescriptor<TIdentifierType>["length"]
Defined in: src/identifier-validator.ts:82
Get the length. For numeric identifier types, the length is fixed; for alphanumeric identifier types, the length is the maximum.
Returns
IdentifierTypeDescriptor<TIdentifierType>["length"]
Inherited from
MixinAbstractNonGTINNumericIdentifierCreator< NonSerializableNumericIdentifierType >(NonSerializableNumericIdentifierValidator).length
referenceCharacterSet
Get Signature
get referenceCharacterSet():
IdentifierTypeDescriptor<TIdentifierType>["referenceCharacterSet"]
Defined in: src/identifier-validator.ts:89
Get the reference character set.
Returns
IdentifierTypeDescriptor<TIdentifierType>["referenceCharacterSet"]
Inherited from
MixinAbstractNonGTINNumericIdentifierCreator< NonSerializableNumericIdentifierType >(NonSerializableNumericIdentifierValidator).referenceCharacterSet
referenceCreator
Get Signature
get referenceCreator():
CharacterSetCreator
Defined in: src/identifier-validator.ts:96
Get the reference creator.
Returns
CharacterSetCreator
Inherited from
MixinAbstractNonGTINNumericIdentifierCreator< NonSerializableNumericIdentifierType >(NonSerializableNumericIdentifierValidator).referenceCreator
capacity
Get Signature
get capacity():
number
Defined in: src/numeric-identifier-creator.ts:17
Get the capacity (10**referenceLength).
Returns
number
Inherited from
MixinAbstractNonGTINNumericIdentifierCreator< NonSerializableNumericIdentifierType >(NonSerializableNumericIdentifierValidator).capacity
tweak
Get Signature
get tweak():
bigint
Defined in: src/numeric-identifier-creator.ts:22
Get the tweak for sparse creation.
Returns
bigint
Set Signature
set tweak(
value):void
Defined in: src/numeric-identifier-creator.ts:27
Set the tweak for sparse creation.
Parameters
value
bigint
Returns
void
Inherited from
MixinAbstractNonGTINNumericIdentifierCreator< NonSerializableNumericIdentifierType >(NonSerializableNumericIdentifierValidator).tweak
prefixProvider
Get Signature
get prefixProvider():
PrefixProvider
Defined in: src/identifier-creator.ts:21
Get the prefix provider to which this identifier creator is bound.
Returns
Inherited from
MixinAbstractNonGTINNumericIdentifierCreator< NonSerializableNumericIdentifierType >(NonSerializableNumericIdentifierValidator).prefixProvider
prefix
Get Signature
get prefix():
string
Defined in: src/identifier-creator.ts:27
Get the prefix, equivalent to calling prefixProvider.prefix for a GTIN or prefixProvider.gs1CompanyPrefix for all other identifier types.
Returns
string
Inherited from
MixinAbstractNonGTINNumericIdentifierCreator< NonSerializableNumericIdentifierType >(NonSerializableNumericIdentifierValidator).prefix
referenceLength
Get Signature
get referenceLength():
number
Defined in: src/identifier-creator.ts:32
Get the reference length.
Returns
number
Inherited from
MixinAbstractNonGTINNumericIdentifierCreator< NonSerializableNumericIdentifierType >(NonSerializableNumericIdentifierValidator).referenceLength
Methods
validate()
validate(
identifier,validation?):void
Defined in: src/numeric-identifier-validator.ts:59
Parameters
identifier
string
validation?
Returns
void
Inherit Doc
Inherited from
MixinAbstractNonGTINNumericIdentifierCreator< NonSerializableNumericIdentifierType >(NonSerializableNumericIdentifierValidator).validate
padIdentifier()
protectedpadIdentifier(identifier,positionOffset?):string
Defined in: src/identifier-validator.ts:113
Pad an identifier on the left with zero-value character for validation purposes. This is done to align an identifier with a position offset for any error message that may be thrown by the reference validator.
Parameters
identifier
string
Identifier.
positionOffset?
number
Position offset within a larger string.
Returns
string
Padded identifier.
Inherited from
MixinAbstractNonGTINNumericIdentifierCreator< NonSerializableNumericIdentifierType >(NonSerializableNumericIdentifierValidator).padIdentifier
validatePrefix()
protectedvalidatePrefix(partialIdentifier):void
Defined in: src/identifier-validator.ts:124
Validate the prefix within an identifier.
Parameters
partialIdentifier
string
Partial identifier.
Returns
void
Inherited from
MixinAbstractNonGTINNumericIdentifierCreator< NonSerializableNumericIdentifierType >(NonSerializableNumericIdentifierValidator).validatePrefix