aboutsummaryrefslogtreecommitdiff
path: root/ber/obj.go
blob: 735ef97c450224e94a32a9c6bdbf00d1bbcfd6ef (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package ber

func base128(n int) (b []byte) {
	l := 0

	for i := n; i > 0; i >>= 7 {
		l++
	}

	for i := l - 1; i >= 0; i-- {
		o := byte(n >> uint(i*7))
		o &= 0x7F
		if i != 0 {
			o |= 0x80
		}
		b = append(b, o)
	}
	return
}

func debase128(b []byte) int {
	return 0
}

func marshalObj(obj []int) []byte {
	return []byte{}
}

func unmarshalObj(b []byte) []int {
	return []int{}
}