mirror of
https://github.com/ergochat/ergo.git
synced 2025-12-20 02:00:11 -08:00
implement ip cloaking
This commit is contained in:
parent
585a6557a4
commit
c28e6d13f9
7 changed files with 216 additions and 3 deletions
|
|
@ -11,7 +11,7 @@ import (
|
|||
|
||||
var (
|
||||
// slingamn's own private b32 alphabet, removing 1, l, o, and 0
|
||||
b32encoder = base32.NewEncoding("abcdefghijkmnpqrstuvwxyz23456789").WithPadding(base32.NoPadding)
|
||||
B32Encoder = base32.NewEncoding("abcdefghijkmnpqrstuvwxyz23456789").WithPadding(base32.NoPadding)
|
||||
)
|
||||
|
||||
const (
|
||||
|
|
@ -24,7 +24,7 @@ func GenerateSecretToken() string {
|
|||
var buf [16]byte
|
||||
rand.Read(buf[:])
|
||||
// 26 ASCII characters, should be fine for most purposes
|
||||
return b32encoder.EncodeToString(buf[:])
|
||||
return B32Encoder.EncodeToString(buf[:])
|
||||
}
|
||||
|
||||
// securely check if a supplied token matches a stored token
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue