Skip to content

Foxcapades/gojasc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JSON Safe Binary Serialization

GitHub tag (latest SemVer) GitHub go.mod Go version GitHub api docs ff69b4 Go badge

GoJasc provides a suite of utilities to serialize data into a binary form that writes its octet output in a JSON safe range of ASCII characters.

Basic Usage
package main

import (
	"encoding/json"
	"math"
	"os"

	"github.com/foxcapades/gojasc/v1/pkg/j57"
)

func main() {
	data := j57.SerializeComplex128(complex(math.MaxFloat64, math.MaxFloat64))

	enc := json.NewEncoder(os.Stdout)
	enc.SetIndent("", "  ")
	enc.SetEscapeHTML(false)

	_ = enc.Encode(string(data))

	// Outputs:
	// ".<=<[[=U=7(/.<=<[[=U=7(/"
}