Product
Introducing License Enforcement in Socket
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
github.com/cristalhq/base64
Faster base64 encoding for Go, based on Turbo-Base64.
encoding/base64
.
\r
and \n
in decoder.encoding/base64
.Go version 1.16+
go get github.com/cristalhq/base64
Replace import statement from encoding/base64
to github.com/cristalhq/base64
-import "encoding/base64"
+import "github.com/cristalhq/base64"
go1.17 linux/amd64, Intel i7-7700
std/Encode 685.3 ns/op 0 B/op 0 allocs/op
std/EncodeToString 951.8 ns/op 2048 B/op 2 allocs/op
std/Decode 803.9 ns/op 0 B/op 0 allocs/op
std/DecodeString 1061 ns/op 1792 B/op 2 allocs/op
own/Encode 217.8 ns/op 0 B/op 0 allocs/op
own/EncodeToString 353.2 ns/op 1024 B/op 1 allocs/op
own/Decode 426.0 ns/op 0 B/op 0 allocs/op
own/DecodeString 598.7 ns/op 768 B/op 1 allocs/op
go1.17 darwin/arm64, Apple M1
std/Encode 413.0 ns/op 0 B/op 0 allocs/op
std/EncodeToString 608.3 ns/op 2048 B/op 2 allocs/op
std/Decode 372.5 ns/op 0 B/op 0 allocs/op
std/DecodeString 570.2 ns/op 1792 B/op 2 allocs/op
own/Encode 146.7 ns/op 0 B/op 0 allocs/op
own/EncodeToString 246.4 ns/op 1024 B/op 1 allocs/op
own/Decode 222.8 ns/op 0 B/op 0 allocs/op
own/DecodeString 303.1 ns/op 768 B/op 1 allocs/op
See these docs.
FAQs
Unknown package
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
Product
We're launching a new set of license analysis and compliance features for analyzing, managing, and complying with licenses across a range of supported languages and ecosystems.
Product
We're excited to introduce Socket Optimize, a powerful CLI command to secure open source dependencies with tested, optimized package overrides.