1
0
Fork 0
mirror of https://github.com/Luzifer/nginx-sso.git synced 2024-12-21 05:11:17 +00:00
nginx-sso/vendor/gopkg.in/asn1-ber.v1/content_int.go
Knut Ahlers 115182e445
Add LDAP support (#3)
* Define configuration for LDAP module
* Implement LDAP auth
* Vendor new dependencies
* Add documentation for LDAP provider
2018-03-15 23:12:09 +01:00

25 lines
312 B
Go

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
}