求 net 这段代码翻译GO

hellsam · · 1548 次点击
<a href="/user/hellsam" title="@hellsam">@hellsam</a> ```go package main import ( &#34;fmt&#34; &#34;math/rand&#34; &#34;time&#34; ) func main() { mac := GetRandMac() fmt.Println(mac) } func GetRandMac() string { rand.Seed(time.Now().Unix()) a := make([]byte, 6) rand.Read(a) return fmt.Sprintf(&#34;%02x:%02x:%02x:%02x:%02x:%02x&#34;, a[0], a[1], a[2], a[3], a[4], a[5]) } ```
#7
更多评论
能简单解释一下这段代码的逻辑吗? 把逻辑说出来,或许能帮你,这.net代码看不懂逻辑
#1
<a href="/user/hshd123" title="@hshd123">@hshd123</a> 是生成一组随机数字 mac,转换16进制
#2