protocol/aprs: refactored
Some checks failed
Run tests / test (1.25) (push) Failing after 1m37s
Run tests / test (stable) (push) Failing after 1m37s

This commit is contained in:
2026-03-02 22:28:17 +01:00
parent 452f521866
commit 63040a44b3
24 changed files with 3506 additions and 1533 deletions

View File

@@ -2,12 +2,14 @@ package aprs
import (
"fmt"
"slices"
)
func base91Decode(s string) (n int, err error) {
for i, l := 0, len(s); i < l; i++ {
c := s[i]
if c < 33 || c > 122 {
// panic(fmt.Sprintf("aprs: invalid base-91 encoding char %q (%d)", c, c))
return 0, fmt.Errorf("aprs: invalid base-91 encoding char %q (%d)", c, c)
}
@@ -17,14 +19,13 @@ func base91Decode(s string) (n int, err error) {
return
}
/*
func base91Encode(n int) string {
var s []string
for n > 0 {
c := n % 91
func base91Encode(b []byte, n int) {
i := 0
for n > 1 {
x := n % 91
n /= 91
s = append([]string{string(byte(c) + 33)}, s...)
b[i] = byte(x) + 33
i++
}
return strings.Join(s, "")
slices.Reverse(b[:i])
}
*/