u
Anirudh Oppiliappan x@icyphox.sh
Sun, 24 Sep 2023 11:00:38 +0300
1 files changed,
7 insertions(+),
1 deletions(-)
jump to
M
masto.go
→
masto.go
@@ -4,9 +4,15 @@ import (
"crypto/rand" "fmt" "net/http" + "time" "humungus.tedunangst.com/r/webs/junk" ) + +func snowflake() uint64 { + ts := time.Now() + return uint64(uint64(ts.UnixNano()/int64(time.Millisecond))<<16 | uint64(time.Now().Nanosecond()&0xffff)) +} func badjunk(rw http.ResponseWriter, j junk.Junk, path string) { elog.Printf("%s: bad junk: %s", path, j.ToString())@@ -36,7 +42,7 @@ return
} j := junk.New() - j["id"] = 1 + j["id"] = snowflake() j["name"] = clientName j["redirect_uri"] = redirectUri j["client_id"] = clientID