Methods
assert(condition, message)
assert expression
Parameters:
Name | Type | Description |
---|---|---|
condition |
bool | assert condtion |
message |
string | assert failed message |
calculateAuth(appkey, random, time, fileSha1sum) → {string}
Calculate a voice uploading request signature
Parameters:
Name | Type | Description |
---|---|---|
appkey |
string | sdk appkey |
random |
string | random string |
time |
number | unix timestamp time |
fileSha1sum |
string | voice file sha1sum |
Returns:
- Type
- string
calculateSignature(appkey, random, time, phoneNumbers) → {string}
Calculate a request signature according to parameters
Parameters:
Name | Type | Description |
---|---|---|
appkey |
string | sdk appkey |
random |
string | random string |
time |
number | unix timestamp time |
phoneNumbers |
array | phone number array |
Returns:
- Type
- string
createQcloudSms(appid, appkey) → {object}
Create a QcloudSms instance
Parameters:
Name | Type | Description |
---|---|---|
appid |
string | sdk appid |
appkey |
string | sdk appkey |
Returns:
- Type
- object
getCurrentTime() → {number}
Get current time
Returns:
- Type
- number
getRandom() → {number}
Get a random number
Returns:
- Type
- number
request(options, callback)
Make a request and call given callback
Parameters:
Name | Type | Description |
---|---|---|
options |
object | request options |
callback |
function | request handler, method signature: function(error, response, responseData) |
sha1sum(buf) → {string}
Calculate sha1sum
Parameters:
Name | Type | Description |
---|---|---|
buf |
Buffer | raw buf |
Returns:
- Type
- string