| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081 |
- package main
- import (
- "fmt"
- "math/rand"
- "strings"
- )
- func main(){
- //watch,err := fsnotify.NewWatcher()
- //if err != nil {
- // log.Error("new watch failed ",err.Error())
- //}
- //defer watch.Close()
- //
- //err = watch.Add("/root/Public/ioc")
- //if err != nil {
- // log.Error("watch ioc file failed ",err.Error())
- //}
- //go func(){
- // select{
- // case event := <-watch.Events:
- // {
- // if event.Op&fsnotify.Create == fsnotify.Create {
- // log.Info("file is created")
- // }
- // if event.Op&fsnotify.Rename == fsnotify.Rename {
- // log.Info("重命名文件 : ")
- // }
- // if event.Op&fsnotify.Remove == fsnotify.Remove {
- // log.Info("rename")
- // }
- // }
- // case err := <-watch.Errors:
- // {
- // log.Error(err.Error())
- // }
- // }
- //
- //
- //}()
- //select {
- //
- //}
- //var connsMap = sync.Map{}
- //connsMap.LoadOrStore(1,"1")
- //var count =0
- //connsMap.Range(func(key interface{}, value interface{}) bool{
- // count++
- // return true
- //})
- //fmt.Println(count)
- //data := "1hxri0ehkQ/bQn2a89P3KZjhLsiiuM5RtzHDhEpKBIgHV8muUzuN2nGoTC86R5cHLfrH3Qh46p/Xhso5TMEAgtXNSIccumZDlJWeTkTsF2RUGnK+N+z3l/pQTvkjO8Z64tYDSnOEoxKPOwuihiqEZVyaYiOYjvCHTG8fAQildqdDq6ux2fXN/R5l8PiLNnMO"
- //decodeStr, err := decode.DecodeCBC(data, "aes_key_16_bytes")
- //fmt.Println(decodeStr,err)
- //uuid,_ := uuid.NewV4()
- //fmt.Println(uuid)
- //requestId := fmt.Sprintf("%.23s",uuid)
- //re := lacia.RemoveX(requestId, "-")
- //fmt.Println(re)
- buf := make([]byte, 6)
- // Set the local bit
- for i:=0; i<10; i++{
- _, err := rand.Read(buf)
- if err != nil {
- fmt.Println("error:", err)
- break
- }
- buf[0] |= 2
- mac:=fmt.Sprintf("%02x%02x%02x%02x%02x%02x", buf[0], buf[1], buf[2], buf[3], buf[4], buf[5])
- fmt.Println(strings.ToUpper(mac))
- }
- //for i:=0;i<10;i++{
- // n:=rand.Intn(10)
- // fmt.Println(n)
- //}
- }
|