Skip to content

StasMerzlyakov/gocer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple Go ASN1 Canonical Encoding Rules (CER) encoding

  • int <-> INTEGER
  • float64 <-> REAL
  • bool <-> BOOLEAN
  • struct <-> SEQUENCE
  • slice <-> SEQUENCEOF
  • string <-> UTF8String
  • nil <-> NULL // for slice

Usage

import (
	"github.com/StasMerzlyakov/gocer/asn1"
)
type TestStuct struct {
	Id int
	E  float64
}

// encode to bytes.Buffer
value := []TestStruct{TestStruct{}, TestStruct{1, math.Pi}}
var bbuffer bytes.Buffer
asn1.Encode(value, &bbuffer)

// decode from bytes.Buffer
var evalue []TestStruct
asn1.Decode(&evalue, &bbuffer)

Authors

  • Stas Merzlyakov - Initial work - info

Links

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages