aboutsummaryrefslogtreecommitdiff
path: root/ber/new/common.go
diff options
context:
space:
mode:
Diffstat (limited to 'ber/new/common.go')
-rw-r--r--ber/new/common.go77
1 files changed, 0 insertions, 77 deletions
diff --git a/ber/new/common.go b/ber/new/common.go
deleted file mode 100644
index 7c4f496..0000000
--- a/ber/new/common.go
+++ /dev/null
@@ -1,77 +0,0 @@
-package ber
-
-import (
- "bytes"
- "strconv"
- "strings"
-)
-
-type state struct{ bytes.Buffer }
-
-func newState(b []byte) *state {
- s := &state{}
- s.Write(b)
- return s
-}
-
-func (s *state) subState() *state {
- ss := state{}
- ss.Write(s.next())
- return &ss
-}
-
-func (s *state) next() []byte {
- l := s.unmarshalLen()
- return s.Next(l)
-}
-
-type OID []int
-
-func (o OID) Equal(p OID) bool {
- if len(o) != len(p) {
- return false
- }
- for i := range o {
- if o[i] != p[i] {
- return false
- }
- }
- return true
-}
-
-func (o OID) String() string {
- s := make([]string, len(o))
- for i, v := range o {
- s[i] = strconv.Itoa(v)
- }
- return strings.Join(s, ".")
-}
-
-type BitString []bool
-
-func (o BitString) Equal(p BitString) bool {
- if len(o) != len(p) {
- return false
- }
- for i := range o {
- if o[i] != p[i] {
- return false
- }
- }
- return true
-}
-
-func (o BitString) String() string {
- bmap := map[bool]string{
- true: "1",
- false: "0",
- }
- var s string
- for i, bit := range o {
- if i != 0 && i%4 == 0 {
- s += " "
- }
- s += bmap[bit]
- }
- return s
-}