wgconf/conf/filewriter.go
Vincent Batts 823fe02331
updates from 2021-04-21
Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
2023-02-17 11:06:30 -05:00

20 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"
}