Namespace: encode
References​
IS_BROWSER​
Re-exports IS_BROWSER
Functions​
arrayBufferToString​
â–¸ arrayBufferToString(array
): string
Parameters​
Name | Type |
---|---|
array | ArrayBuffer |
Returns​
string
Defined in​
stringToArrayBuffer​
â–¸ stringToArrayBuffer(s
): Uint8Array
Parameters​
Name | Type |
---|---|
s | string |
Returns​
Uint8Array
Defined in​
atobUniversal​
â–¸ atobUniversal(a
): Uint8Array
Parameters​
Name | Type |
---|---|
a | string |
Returns​
Uint8Array
Defined in​
btoaUniversal​
â–¸ btoaUniversal(b
): string
Parameters​
Name | Type |
---|---|
b | ArrayBuffer |
Returns​
string
Defined in​
buf2hex​
â–¸ buf2hex(buffer
): string
Parameters​
Name | Type |
---|---|
buffer | Uint8Array |
Returns​
string
Defined in​
removeHexPrefix​
â–¸ removeHexPrefix(hex
): string
Some function imported from https://github.com/pedrouid/enc-utils/blob/master/src/index.ts
enc-utils is no dependency to avoid using Buffer
which just works in node and no browsers
Parameters​
Name | Type |
---|---|
hex | string |
Returns​
string
Defined in​
addHexPrefix​
â–¸ addHexPrefix(hex
): string
Parameters​
Name | Type |
---|---|
hex | string |
Returns​
string
Defined in​
padLeft​
â–¸ padLeft(str
, length
, padding?
): string
Parameters​
Name | Type | Default value |
---|---|---|
str | string | undefined |
length | number | undefined |
padding | string | STRING_ZERO |
Returns​
string
Defined in​
calcByteLength​
â–¸ calcByteLength(length
, byteSize?
): number
Parameters​
Name | Type | Default value |
---|---|---|
length | number | undefined |
byteSize | number | 8 |
Returns​
number
Defined in​
sanitizeBytes​
â–¸ sanitizeBytes(str
, byteSize?
, padding?
): string
Parameters​
Name | Type | Default value |
---|---|---|
str | string | undefined |
byteSize | number | 8 |
padding | string | STRING_ZERO |
Returns​
string
Defined in​
sanitizeHex​
â–¸ sanitizeHex(hex
): string
Parameters​
Name | Type |
---|---|
hex | string |
Returns​
string
Defined in​
utf8ToArray​
â–¸ utf8ToArray(str
): Uint8Array
Parameters​
Name | Type |
---|---|
str | string |
Returns​
Uint8Array
Defined in​
pascalToSnake​
â–¸ pascalToSnake(text
): string
String transformation util pascal case to screaming snake case
Parameters​
Name | Type | Description |
---|---|---|
text | string | string |
Returns​
string
string