21 lines
335 B
Go
21 lines
335 B
Go
/* SPDX-License-Identifier: MIT
|
|
*
|
|
* Copyright (C) 2019-2021 WireGuard LLC. All Rights Reserved.
|
|
*/
|
|
|
|
package conf
|
|
|
|
import (
|
|
"crypto/rand"
|
|
"encoding/hex"
|
|
)
|
|
|
|
func randomFileName() string {
|
|
var randBytes [32]byte
|
|
_, err := rand.Read(randBytes[:])
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
return hex.EncodeToString(randBytes[:]) + ".tmp"
|
|
}
|