mirror of
https://github.com/ultrasn0w/huso.git
synced 2025-12-14 05:39:52 +01:00
POST watching
This commit is contained in:
26
rechner.go
Normal file
26
rechner.go
Normal file
@@ -0,0 +1,26 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"crypto/sha512"
|
||||
"encoding/binary"
|
||||
"fmt"
|
||||
"strconv"
|
||||
)
|
||||
|
||||
func Sauce(malid int64, username string) string {
|
||||
return fmt.Sprintf("%x", sha512.Sum512([]byte(registerSecret+strconv.FormatInt(malid, 10)+username)))
|
||||
}
|
||||
|
||||
func BytesToInt64(bytes []byte) (int64, error) {
|
||||
yes, c := binary.Varint(bytes)
|
||||
if c <= 0 {
|
||||
return yes, fmt.Errorf("int64 decode error: %s", bytes)
|
||||
}
|
||||
return yes, nil
|
||||
}
|
||||
|
||||
func Int64ToByte(yes int64) []byte {
|
||||
buf := make([]byte, binary.MaxVarintLen64)
|
||||
n := binary.PutVarint(buf, yes)
|
||||
return buf[:n]
|
||||
}
|
||||
Reference in New Issue
Block a user