Shift things around - remove native

This commit is contained in:
Owen
2025-11-17 13:39:32 -05:00
parent 491180c6a1
commit dbbea6b34c
8 changed files with 184 additions and 1088 deletions

View File

@@ -1,6 +1,8 @@
package util
import (
"encoding/base64"
"encoding/hex"
"fmt"
"net"
"strings"
@@ -120,3 +122,17 @@ func FindAvailableUDPPort(minPort, maxPort uint16) (uint16, error) {
return 0, fmt.Errorf("no available consecutive UDP ports found in range %d-%d", minPort, maxPort)
}
func FixKey(key string) string {
// Remove any whitespace
key = strings.TrimSpace(key)
// Decode from base64
decoded, err := base64.StdEncoding.DecodeString(key)
if err != nil {
logger.Fatal("Error decoding base64: %v", err)
}
// Convert to hex
return hex.EncodeToString(decoded)
}