From 4e50fd864921c556988c919269448efdb90fa961 Mon Sep 17 00:00:00 2001 From: Wim Date: Mon, 10 Aug 2020 00:29:54 +0200 Subject: Use mattermost v5 module (#1192) --- .../github.com/go-asn1-ber/asn1-ber/content_int.go | 25 ++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 vendor/github.com/go-asn1-ber/asn1-ber/content_int.go (limited to 'vendor/github.com/go-asn1-ber/asn1-ber/content_int.go') diff --git a/vendor/github.com/go-asn1-ber/asn1-ber/content_int.go b/vendor/github.com/go-asn1-ber/asn1-ber/content_int.go new file mode 100644 index 00000000..1858b74b --- /dev/null +++ b/vendor/github.com/go-asn1-ber/asn1-ber/content_int.go @@ -0,0 +1,25 @@ +package ber + +func encodeUnsignedInteger(i uint64) []byte { + n := uint64Length(i) + out := make([]byte, n) + + var j int + for ; n > 0; n-- { + out[j] = (byte(i >> uint((n-1)*8))) + j++ + } + + return out +} + +func uint64Length(i uint64) (numBytes int) { + numBytes = 1 + + for i > 255 { + numBytes++ + i >>= 8 + } + + return +} -- cgit v1.2.3