original document (abstract)
Document Address:http://mp.weixin.qq.com/wiki/8/f9a0b8382e0b77d87b3bcc1ce6fbc104.htmlwith the development of the public platform, developers need to complete the following steps:
1, fill in the server configuration2, verify the validity of the server address3. Implement business logic according to interface document
Third, document understanding
Verify the validity of the server address
1, the API this introduction:
After the developer submits the information,
Reader's expectation: This paper is suitable for readers who have read the source code of the Bitcoin mining algorithm or understand the main process of mining algorithm.
Introduction:
A piece of pseudo code:
nonce=0;
while (Nonce
The process of digging is to change the nonce, to calculate the sha256 Double Data Digest of the block head, if
signature (there is a check method below). If you confirm that this GET request comes from a micro-trust server, return the ECHOSTR parameter content as is, the access is valid, or the access fails.
Signature combines the token parameters and timestamp parameters and Nonce parameters that are filled in by the developer.
Encryption/validation Process:
1, the token, timestamp, nonce three parameters are s
1. Install Geth Client
Geth is the Go Ethereum, which is the Ethereum client implemented with the go language. Geth is a concrete implementation of the Ethereum protocol, through Geth, you can realize the various functions of ethereum, such as the new edit delete account, open mining, ether currency transfer, intelligent contract deployment and implementation and so on.
Download Address: https://geth.ethereum.org/downloads/
Installation Guide: Https://github.com/ethereum/go-ethereum/wiki/Buildin
After the developer submits the information, the server sends a GET request to the filled server address URL, and the GET request carries four parameters:
Parameters
Describe
Signature
The cryptographic signature, signature, combines the token parameters and the timestamp parameters and Nonce parameters that the developer fills in.
Timestamp
Time stamp
Application -String Appsecret = "610128b2fabe";//password for the app -String nonce = "123456";//Random number -String mobile = "18201623501";//Target Phone number inString curtime=string.valueof ((NewDate (). GetTime ()/1000l)); -String checkSum = Getchecksum (Appsecret, nonce, curtime);//get the parameters required to send the verification code checksum to +Closeablehttpclient httpclient =Httpcl
The connection of the public number to its own project, that is, the public number will hand over the relevant events to your own project, you need to provide a portal, that is, a servlet URL1. Create a servlet to process the validation message in the Doget method for the public number docking1 Public classWeixinservletextendsHttpServlet {2 3 Private Static Final LongSerialversionuid = 1L;4 5 PublicWeixinservlet () {6 }7 8 Public voiddestroy () {9 }Ten One Public voi
Verification principle:
Signature: Encrypted signature, signature combined with the developer's token parameters and timestamp parameters in the request, nonce parameters.
which
Timestamp: Time stamp
Nonce: Random number
echostr: Random string1. The token, timestamp, nonce three parameters are ordered in dictionary order.
2. Stitch three parameters into a string
Today to get the service number of the message reply to the custom PHP, found that the company's service number does not work properly, but with their own public number can automatically reply to the message
What would be the cause of this situation, please?
Valid ();} else{$wechatObj->responsemsg ();} Class wechatcallbackapitest{Public Function valid () {$echoStr = $_get["Echostr"]; if ($this->checksignature ()) {header (' content-type:text '); Echo $echoStr;
configuration will fail, because there is no server verification, you need to write a file named index. php:Define ("TOKEN", "Your Own Token value ");$ WechatObj = new wechat_php ();$ WechatObj-> valid ();Class wechat_php{Public function valid (){$ Echostr = $ _ GET ['echostr'];If ($ this-> checksignature ()){Echo $ echostr;Exit;}}Private function checksignature (){/** Interface Verification **/$ Signature = $ _ GET ['signature'];$ Timestamp = $ _ GET ['timestamp'];$
Today, I got a message from the service number to reply to the custom php and found that the service number of the company could not run normally, however, you can use your own public account to automatically reply to the message. what is the cause of this situation? {code ...} get the message of service number reply custom php today, found that the service number of the company cannot run normally, but with their own public number can automatically reply to the message
What is the cause of this
Block hashing algorithmBitcoin Mining uses thehashcashproof of work function; The Hashcash algorithm requires the following PARAMETERS:A service string, a nonce, and a counter. In bitcoin the service string was encoded in the block header data structure, and includes a version field, the hash of the Previous block, the root hash of the Merkle tree of all transactions in the block, the current time, and the difficulty. Bitcoin stores the
client;Private String username; Login account (Clear text)private String password; Login password (plaintext)Private String su; Login account (BASE64 encryption)Private String sp; Login password (various parameters RSA encrypted cipher)Private long servertime; The time stamp returned by the server when the initial login is used for password encryption and loginPrivate String nonce; At initial login, the server returns a string of characters used for
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.