(size int)
| 117 | } |
| 118 | |
| 119 | func panelRandomToken(size int) string { |
| 120 | buf := make([]byte, size) |
| 121 | if _, err := rand.Read(buf); err != nil { |
| 122 | return fmt.Sprintf("pulse-secret-%d", time.Now().UnixNano()) |
| 123 | } |
| 124 | return fmt.Sprintf("%x", buf) |
| 125 | } |
| 126 | |
| 127 | // ─── 公开 API ───────────────────────────────────────────────────────────────── |
| 128 |
no test coverage detected