This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package test | |
type Handler func(str string) string | |
type FuncMap map[string]Handler | |
func aDo() { | |
p := "message" | |
S := "key" | |
Fn := make(FuncMap) | |
// 这里的[]是取下标 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 使用前先安装 md5 模块 : npm install md5 | |
const md5 = require("md5") | |
// 时间戳截取长度 , 从后向前截取 | |
const LENGTH = 6 | |
// check proof of work data | |
const checkPow = (randomTxt, timestamp) => { | |
let [numStr] = getTimeState(timestamp) | |
let randMd5Str = md5(randomTxt) |