mirror of
https://github.com/mainflux/mainflux.git
synced 2025-04-29 13:49:28 +08:00
![dependabot[bot]](/assets/img/avatar_default.png)
Bumps [github.com/lestrrat-go/jwx/v2](https://github.com/lestrrat-go/jwx) from 2.0.8 to 2.0.11. - [Release notes](https://github.com/lestrrat-go/jwx/releases) - [Changelog](https://github.com/lestrrat-go/jwx/blob/develop/v2/Changes) - [Commits](https://github.com/lestrrat-go/jwx/compare/v2.0.8...v2.0.11) --- updated-dependencies: - dependency-name: github.com/lestrrat-go/jwx/v2 dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
43 lines
893 B
Go
43 lines
893 B
Go
//go:build arm64 && !purego
|
|
// +build arm64,!purego
|
|
|
|
package base64
|
|
|
|
import (
|
|
"encoding/base64"
|
|
)
|
|
|
|
const (
|
|
encLutSize = 16
|
|
decLutSize = 2
|
|
minEncodeLen = 16 * 3
|
|
minDecodeLen = 8 * 4
|
|
)
|
|
|
|
func newEncoding(encoder string) *Encoding {
|
|
e := &Encoding{base: base64.NewEncoding(encoder)}
|
|
e.enableEncodeARM64(encoder)
|
|
e.enableDecodeARM64(encoder)
|
|
return e
|
|
}
|
|
|
|
func (e *Encoding) enableEncodeARM64(encoder string) {
|
|
c62, c63 := int8(encoder[62]), int8(encoder[63])
|
|
tab := [encLutSize]int8{
|
|
'a' - 26, '0' - 52, '0' - 52, '0' - 52, '0' - 52, '0' - 52, '0' - 52, '0' - 52,
|
|
'0' - 52, '0' - 52, '0' - 52, c62 - 62, c63 - 63, 'A', 0, 0,
|
|
}
|
|
|
|
e.enc = encodeARM64
|
|
e.enclut = tab
|
|
}
|
|
|
|
func (e *Encoding) enableDecodeARM64(encoder string) {
|
|
if encoder == encodeStd {
|
|
e.dec = decodeStdARM64
|
|
} else {
|
|
e.dec = decodeARM64
|
|
}
|
|
e.declut = [decLutSize]int8{int8(encoder[62]), int8(encoder[63])}
|
|
}
|