@telegram-auth/server
Ƭ AuthDataMap: Map<string, string | number>
Shape of the data to be passed AuthDataValidator.validate().
▸ hexStringToArrayBuffer(hexString): Uint8Array
It takes a hex string and returns an array buffer
| Name | Type | Description |
|---|---|---|
hexString |
string |
The hex string to convert to an array buffer. |
A Uint8Array of the hexString.
utils/hexStringToArrayBuffer.ts:7
▸ searchParamsToAuthDataMap(searchParams): AuthDataMap
It takes a URLSearchParams object and returns auth data Map. It's useful for parsing the URLSearchParams received from Telegram.
| Name | Type | Description |
|---|---|---|
searchParams |
URLSearchParams |
URLSearchParams |
A new Map object with the entries from the searchParams object.
utils/searchParamsToAuthDataMap.ts:10
▸ objectToAuthDataMap(data): AuthDataMap
It takes an object and returns auth data Map
| Name | Type | Description |
|---|---|---|
data |
Record<string, string | number> |
The object to convert to a Map |
A new Map object with the entries of the object passed in.
utils/objectToAuthDataMap.ts:9
▸ urlStrToAuthDataMap(urlStr): Map<string, string>
It takes a URL string and returns auth data Map from the URL's query parameters. It's useful for parsing the URL received from Telegram.
| Name | Type | Description |
|---|---|---|
urlStr |
string |
The URL string to parse. |
Map<string, string>
A Map object with the key/value pairs from the URL's query string.