Joke Collection Website - Blessing messages - Short message length field
Short message length field
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.
- Previous article:Hangzhou Bank's new wallet can't show the balance.
- Next article:Farewell greetings to colleagues after leaving office.
- Related articles
- Birthday greetings to female friends
- Excerpt from a happy copy about going home from work to eat.
- Will Harbin’s vehicle inspection be delayed in 2022?
- How to translate Chinese into Burmese on mobile phone?
- What if the blind date girl doesn't take the initiative to contact, but replies to the message?
- How to view the details of WeChat collection?
- Why is there no record of police anti-fraud SMS?
- If you are a store manager, how do you motivate your employees at work? Where do you start from?
- Does Xinye Technology participate in the detection of police telecom fraud?
- How to inquire about the progress of Hubei Xiangyang provident fund loan