From 6c8904606f6455b82e5ec9fad5f18f1cd587d5ef Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Tue, 30 Jun 2015 19:47:04 +0200 Subject: Add uint --- ber/int.go | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'ber/int.go') diff --git a/ber/int.go b/ber/int.go index a8fe19c..5bfcd89 100644 --- a/ber/int.go +++ b/ber/int.go @@ -32,6 +32,13 @@ func unmarshalInt(b []byte) (i int64) { return } +func unmarshalUint(b []byte) (i int64) { + for n, v := range b { + i += int64(v) << uint((n-1)*8) + } + return +} + func marshalInt(i int64) (b []byte) { for n := intLen(i); n > 0; n-- { b = append(b, byte(i>>uint((n-1)*8))) -- cgit v1.2.3