Skip to main content
Version: 5.14.1

Namespace: shortString

Functions

isASCII

isASCII(str): boolean

Parameters

NameType
strstring

Returns

boolean

Defined in

src/utils/shortString.ts:6


isShortString

isShortString(str): boolean

Parameters

NameType
strstring

Returns

boolean

Defined in

src/utils/shortString.ts:12


isDecimalString

isDecimalString(decim): boolean

Parameters

NameType
decimstring

Returns

boolean

Defined in

src/utils/shortString.ts:17


isText

isText(val): boolean

check if value is string text, and not string-hex, string-number

Parameters

NameTypeDescription
valanyany

Returns

boolean

boolean

Defined in

src/utils/shortString.ts:26


splitLongString

splitLongString(longStr): string[]

Parameters

NameType
longStrstring

Returns

string[]

Defined in

src/utils/shortString.ts:33


encodeShortString

encodeShortString(str): string

Convert an ASCII string to an hexadecimal string.

Example

const myEncodedString: string = encodeShortString("uri/pict/t38.jpg");

returns : string : "0x7572692f706963742f7433382e6a7067"

Parameters

NameTypeDescription
strstringASCII string - 31 characters maxi. Ex : "uri/item23.jpg"

Returns

string

a string representing an Hex number 248 bits max.

Defined in

src/utils/shortString.ts:49


decodeShortString

decodeShortString(str): string

Convert an hexadecimal or decimal string to an ASCII string.

Example

const myDecodedString: string = decodeShortString("0x7572692f706963742f7433382e6a7067");

return : string : "uri/pict/t38.jpg"

Parameters

NameTypeDescription
strstringstring - representing a 248 bits max number. Ex : hex : "0x1A4F64EA56" or decimal : "236942575435676423"

Returns

string

a string with 31 characters max.

Defined in

src/utils/shortString.ts:67


isShortText

isShortText(val): boolean

Parameters

NameType
valany

Returns

boolean

Defined in

src/utils/shortString.ts:30


isLongText

isLongText(val): boolean

Parameters

NameType
valany

Returns

boolean

Defined in

src/utils/shortString.ts:31