Module: encoding
Classes
Interfaces
References
base32ToBytes
Re-exports base32ToBytes
bytesToBase32
Re-exports bytesToBase32
isBase64
Re-exports isBase64
Type Aliases
SerializableConstructor
Ƭ SerializableConstructor: (...args: any[]) =>
Serializable
Type declaration
• (...args)
Generic type representing the constructor of a class extending Serializable
Parameters
| Name | Type |
|---|---|
...args |
any[] |
Defined in
Functions
AsBigInteger
▸ AsBigInteger(toProperty?): (proto:
Serializable, prop: string) =>
void
Decorator for defining request handler methods
Parameters
| Name | Type |
|---|---|
toProperty? |
string |
Returns
fn
▸ (proto, prop): void
Parameters
| Name | Type |
|---|---|
proto |
Serializable |
prop |
string |
Returns
void
Defined in
AsBytes
▸ AsBytes(toProperty?): (proto:
Serializable, prop: string) =>
void
Parameters
| Name | Type |
|---|---|
toProperty? |
string |
Returns
fn
▸ (proto, prop): void
Parameters
| Name | Type |
|---|---|
proto |
Serializable |
prop |
string |
Returns
void
Defined in
AsDate
▸ AsDate(toProperty?): (proto:
Serializable, prop: string) =>
void
Parameters
| Name | Type |
|---|---|
toProperty? |
string |
Returns
fn
▸ (proto, prop): void
Parameters
| Name | Type |
|---|---|
proto |
Serializable |
prop |
string |
Returns
void
Defined in
AsSerializable
▸ AsSerializable(cls, toProperty?): (proto:
Serializable, prop: string) =>
void
Decorator for defining request handler methods
Parameters
| Name | Type |
|---|---|
cls |
SerializableConstructor |
toProperty? |
string |
Returns
fn
▸ (proto, prop): void
Parameters
| Name | Type |
|---|---|
proto |
Serializable |
prop |
string |
Returns
void
Defined in
AsSet
▸ AsSet(toProperty?): (proto:
Serializable, prop: string) =>
void
Parameters
| Name | Type |
|---|---|
toProperty? |
string |
Returns
fn
▸ (proto, prop): void
Parameters
| Name | Type |
|---|---|
proto |
Serializable |
prop |
string |
Returns
void
Defined in
Exclude
▸ Exclude(): (proto:
Serializable, prop: string) =>
void
Returns
fn
▸ (proto, prop): void
Parameters
| Name | Type |
|---|---|
proto |
Serializable |
prop |
string |
Returns
void
Defined in
Serialize
▸ Serialize(opts): (proto:
Serializable, prop: string) =>
void
Parameters
| Name | Type |
|---|---|
opts |
Partial<SerializationOptions> |
Returns
fn
▸ (proto, prop): void
Parameters
| Name | Type |
|---|---|
proto |
Serializable |
prop |
string |
Returns
void
Defined in
base64ByteLength
▸ base64ByteLength(inp): number
Returns the byte length of a base64 string
Parameters
| Name | Type |
|---|---|
inp |
string |
Returns
number
Defined in
base64ToBytes
▸ base64ToBytes(inp): Uint8Array
Converts a base64 string to a byte array
Parameters
| Name | Type |
|---|---|
inp |
string |
Returns
Uint8Array
Defined in
base64ToHex
▸ base64ToHex(b64): string
Converts a base64 string to its hexadecimal representation
Parameters
| Name | Type |
|---|---|
b64 |
string |
Returns
string
Defined in
base64ToString
▸ base64ToString(inp): string
Converts the base64 representation of a utf-a string to it's original representation
Parameters
| Name | Type |
|---|---|
inp |
string |
Returns
string
Defined in
bytesToBase64
▸ bytesToBase64(inp, urlSafe?): string
Converts a byte array to a base64 string
Parameters
| Name | Type | Default value |
|---|---|---|
inp |
Uint8Array |
undefined |
urlSafe |
boolean |
true |
Returns
string
Defined in
bytesToHex
▸ bytesToHex(bytes): string
Converts a byte array to its hexadecimal representation
Parameters
| Name | Type |
|---|---|
bytes |
Uint8Array |
Returns
string
Defined in
bytesToNum
▸ bytesToNum(bytes): number
Parameters
| Name | Type |
|---|---|
bytes |
Uint8Array |
Returns
number
Defined in
bytesToString
▸ bytesToString(bytes, encoding?): string
Converts a byte array to an utf-8 string
Parameters
| Name | Type | Default value |
|---|---|---|
bytes |
Uint8Array |
undefined |
encoding |
string |
"utf-8" |
Returns
string
Defined in
concatBytes
▸ concatBytes(arrs, delimiter?): Uint8Array
Concatenates a number of Uint8Arrays to a single array
Parameters
| Name | Type |
|---|---|
arrs |
Uint8Array[] |
delimiter? |
number |
Returns
Uint8Array
Defined in
equalBytes
▸ equalBytes(a, b): boolean
Checks two byte arrays for equality
Parameters
| Name | Type |
|---|---|
a |
Uint8Array |
b |
Uint8Array |
Returns
boolean
Defined in
hexToBase64
▸ hexToBase64(hex): string
Converts a hex string to its base64 representation
Parameters
| Name | Type |
|---|---|
hex |
string |
Returns
string
Defined in
hexToBytes
▸ hexToBytes(str): Uint8Array
Converts a hex string to a byte array
Parameters
| Name | Type |
|---|---|
str |
string |
Returns
Uint8Array
Defined in
marshal
▸ marshal(obj): string
Creates a string from a raw javascript object
Parameters
| Name | Type |
|---|---|
obj |
object |
Returns
string
Defined in
numToBytes
▸ numToBytes(num): Uint8Array
Parameters
| Name | Type |
|---|---|
num |
number |
Returns
Uint8Array
Defined in
stringToBase64
▸ stringToBase64(str, urlSafe?): string
Converts a utf-8 string to its base64 representation
Parameters
| Name | Type | Default value |
|---|---|---|
str |
string |
undefined |
urlSafe |
boolean |
true |
Returns
string
Defined in
stringToBytes
▸ stringToBytes(str): Uint8Array
Converts a utf-8 string to a byte array
Parameters
| Name | Type |
|---|---|
str |
string |
Returns
Uint8Array
Defined in
unmarshal
▸ unmarshal(str): any
Creates a raw javascript object from a string
Parameters
| Name | Type |
|---|---|
str |
string |
Returns
any