don't use 65534

This commit is contained in:
Zack Scholl 2019-11-12 14:31:15 -08:00
parent 09e88d41d1
commit 1fb242308d
2 changed files with 3 additions and 1 deletions

View File

@ -23,7 +23,6 @@ func Bundle(payload interface{}, key []byte) (bundled string, err error) {
return
}
}
// TODO: use base-122 encoding instead? https://github.com/kevinAlbs/Base122
bundled = base64.StdEncoding.EncodeToString(p)
return
}
@ -34,6 +33,7 @@ func Unbundle(bundled string, key []byte, payload interface{}) (err error) {
if err != nil {
return
}
if key != nil {
b, err = crypt.Decrypt(b, key)
if err != nil {

View File

@ -1,6 +1,7 @@
package box
import (
"fmt"
"testing"
"github.com/schollz/croc/v7/src/crypt"
@ -33,6 +34,7 @@ func TestBox(t *testing.T) {
bundled, err := Bundle(M{"hello, world"}, key)
assert.Nil(t, err)
fmt.Println(bundled, len(bundled))
var m M
err = Unbundle(bundled, key, &m)