Skip to content

Instantly share code, notes, and snippets.

View einsitang's full-sized avatar
🏠
Working at home

爱因斯唐 einsitang

🏠
Working at home
View GitHub Profile
@einsitang
einsitang / a.go
Last active June 5, 2023 13:53
go 泛型歧义
package test
type Handler func(str string) string
type FuncMap map[string]Handler
func aDo() {
p := "message"
S := "key"
Fn := make(FuncMap)
// 这里的[]是取下标
@einsitang
einsitang / pow.js
Created June 3, 2023 16:39
proof-of-work
// 使用前先安装 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)