discord-exploits/modules/name.go
schmenn 5113344272
Implemented FFmpeg Transcoding (#2)
* implemented core ffmpeg functions

[TODO] update README.md and clean code

* Forgot to remove image files afterwards

fucking dumbass

* Upgraded FFmpeg implementation

[^] README.md | for transcoding information
[-] exploits.go | removed skipArg completely as it's not needed at all
[^] exploits.go | changed mode handler because I made a mistake which  makes v the zero duration video mode
[^] .gitignore | added .jpg
[^] transcode-to-webm.go => transcode.go | fixed FFmpeg output and made it print the temporary file location
[^] name.go | made file name longer and changed Unix to UnixNano because the seed as Unix sometimes creates two identical file names when images are transcoded as it is really fast
[^] help.go | changed "doesn't" to "don't"
[^] ffmpeg-check.go | changed error checking function to the one already present in modules/error.go
2021-01-15 11:52:04 +01:00

18 lines
372 B
Go

package modules
import (
"math/rand"
"time"
)
// CreateName generates a random file name
func CreateName(extension string) string {
charset := "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
b := make([]byte, 8)
rand.Seed(time.Now().UnixNano())
for i := range b {
b[i] = charset[rand.Intn(len(charset))]
}
return string(b) + "." + extension
}