Joke Collection Website - Blessing messages - Short message length field

Short message length field

According to my following words:

const? Password? =? Request ("crypto");

Function? Signature ()

{

var? strMobile? =? "This is my mobile phone"; ? //The contents of the mobile field of //tel.

var? strAppKey? =? "This is my key"; ? //appkey corresponding to //sdkappid needs to be kept highly confidential by business parties.

var? strRand? =? "7226249334"; ? //The value of the random field in the //url.

var? strTime? =? " 1457336869"; ? //unix timestamp

var? buf? =? " appkey = "+strAppKey+" & amp; random = "+strRand+" & amp; Time = "

+strTime+" & amp; mobile = "+strMobile;

var? sig? =? crypto.createHash('sha256 ')。 Update (buf,? utf-8’)。 digest(' hex ');

Return? sig

}

console . log(SIG()); The output results are as follows:

7b1e97051886ad66c684530db2b01644f828f31E06D624d88af5469afaa0 The reason is that utf-8 is emphasized in the document, but the default encoding of js is not this, so it needs to be specified.

In addition, the calculation result of this sig is related to your output parameters, not a constant.

There is also how your mobile phone and appkey are delivered in Chinese, and the official ones seem to be numbers and letters.