Пока что только user contoller файл создал и пример генератора токенов
This commit is contained in:
parent
1e4c23782b
commit
166a0183f6
|
@ -1 +1,19 @@
|
||||||
package controllers
|
package controllers
|
||||||
|
|
||||||
|
// Пример генератора токена
|
||||||
|
|
||||||
|
import (
|
||||||
|
"crypto/rand"
|
||||||
|
"fmt"
|
||||||
|
)
|
||||||
|
|
||||||
|
func tokenGenerator() string {
|
||||||
|
b := make([]byte, 4)
|
||||||
|
rand.Read(b)
|
||||||
|
return fmt.Sprintf("%x", b)
|
||||||
|
}
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
a := tokenGenerator()
|
||||||
|
fmt.Println(a)
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue