Methods
# hexToDec(hexStr) → {string|null}
Converts hex to decimal
Parameters:
| Name | Type | Description |
|---|---|---|
hexStr |
string
|
Hex string to convert |
string
|
null
# removeUndefined(obj) → {any}
Removes undefined values from an object
Parameters:
| Name | Type | Description |
|---|---|---|
obj |
any
|
any
# stream2buffer(stream, preallocopt) → {Promise.<Buffer>}
Converts a stream to a buffer
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
stream |
Readable
|
The stream to convert |
|
prealloc |
number
|
<optional> |
The size to preallocate for the buffer |
Promise.<Buffer>
# validateCaptcha(token) → {Promise.<{success: boolean, error: ?string}>}
Validates captcha code
Parameters:
| Name | Type | Description |
|---|---|---|
token |
string
|
Promise.<{success: boolean, error: ?string}>