mirror of
https://gitlab.com/mbugroup/lti-api.git
synced 2026-05-25 07:45:44 +00:00
.
This commit is contained in:
committed by
Adnan Zahir
parent
d41e16cab9
commit
ad815b3412
+20
@@ -0,0 +1,20 @@
|
||||
// +build amd64,go1.17,!go1.24
|
||||
|
||||
package rt
|
||||
|
||||
import (
|
||||
"github.com/cloudwego/base64x"
|
||||
)
|
||||
|
||||
func DecodeBase64(raw []byte) ([]byte, error) {
|
||||
ret := make([]byte, base64x.StdEncoding.DecodedLen(len(raw)))
|
||||
n, err := base64x.StdEncoding.Decode(ret, raw)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return ret[:n], nil
|
||||
}
|
||||
|
||||
func EncodeBase64(src []byte) string {
|
||||
return base64x.StdEncoding.EncodeToString(src)
|
||||
}
|
||||
Reference in New Issue
Block a user