读取一些加密随机数据。将随机数据转换为字符串。 // N is number of bytes of random data to // to read. I set to N, the same number of // bytes in a UUID. const N = 16 p := make([]byte, N) if _, err := rand.Read(p); err != nil { // TODO: handle error } id := fmt.Sprintf("%x", p)