updates from 2021-04-21
Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
This commit is contained in:
parent
d5812860fc
commit
823fe02331
7 changed files with 114 additions and 58 deletions
20
conf/filewriter.go
Normal file
20
conf/filewriter.go
Normal file
|
@ -0,0 +1,20 @@
|
|||
/* 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"
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue