20 lines
341 B
Go
20 lines
341 B
Go
|
package main
|
||
|
|
||
|
import (
|
||
|
"crypto/hmac"
|
||
|
"crypto/sha512"
|
||
|
"encoding/base64"
|
||
|
"fmt"
|
||
|
"os"
|
||
|
"time"
|
||
|
)
|
||
|
|
||
|
func main() {
|
||
|
sharedSecret := "adelina"
|
||
|
if len(os.Args) > 1 {
|
||
|
sharedSecret = os.Args[1]
|
||
|
}
|
||
|
|
||
|
fmt.Println(base64.StdEncoding.EncodeToString(hmac.New(sha512.New, []byte(sharedSecret)).Sum([]byte(fmt.Sprintf("%d", time.Now().Unix()/10)))))
|
||
|
}
|