File tree Expand file tree Collapse file tree 3 files changed +16
-10
lines changed
Expand file tree Collapse file tree 3 files changed +16
-10
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,17 @@ This package provides various compression algorithms.
1414[ ![ Go] ( https://github.com/klauspost/compress/actions/workflows/go.yml/badge.svg )] ( https://github.com/klauspost/compress/actions/workflows/go.yml )
1515[ ![ Sourcegraph Badge] ( https://sourcegraph.com/github.com/klauspost/compress/-/badge.svg )] ( https://sourcegraph.com/github.com/klauspost/compress?badge )
1616
17+ # package usage
18+
19+ Use ` go get github.com/klauspost/compress@latest ` to add it to your project.
20+
21+ This package will support the current Go version and 2 versions back.
22+
23+ * Use the ` nounsafe ` tag to disable all use of the "unsafe" package.
24+ * Use the ` noasm ` tag to disable all assembly across packages.
25+
26+ Use the links above for more information on each.
27+
1728# changelog
1829
1930* Sep 23rd, 2024 - [ 1.17.10] ( https://github.com/klauspost/compress/releases/tag/v1.17.10 )
Original file line number Diff line number Diff line change 44 "io"
55 "math"
66 "sync"
7+
8+ "github.com/klauspost/compress/internal/le"
79)
810
911const (
@@ -152,18 +154,11 @@ func hashSL(u uint32) uint32 {
152154}
153155
154156func load3216 (b []byte , i int16 ) uint32 {
155- // Help the compiler eliminate bounds checks on the read so it can be done in a single read.
156- b = b [i :]
157- b = b [:4 ]
158- return uint32 (b [0 ]) | uint32 (b [1 ])<< 8 | uint32 (b [2 ])<< 16 | uint32 (b [3 ])<< 24
157+ return le .Load32 (b , i )
159158}
160159
161160func load6416 (b []byte , i int16 ) uint64 {
162- // Help the compiler eliminate bounds checks on the read so it can be done in a single read.
163- b = b [i :]
164- b = b [:8 ]
165- return uint64 (b [0 ]) | uint64 (b [1 ])<< 8 | uint64 (b [2 ])<< 16 | uint64 (b [3 ])<< 24 |
166- uint64 (b [4 ])<< 32 | uint64 (b [5 ])<< 40 | uint64 (b [6 ])<< 48 | uint64 (b [7 ])<< 56
161+ return le .Load64 (b , i )
167162}
168163
169164func statelessEnc (dst * tokens , src []byte , startAt int16 ) {
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ A high performance compression algorithm is implemented. For now focused on spee
66
77This package provides [ compression] ( #Compressor ) to and [ decompression] ( #Decompressor ) of Zstandard content.
88
9- This package is pure Go and without use of "unsafe".
9+ This package is pure Go. Use ` noasm ` and ` nounsafe ` to disable relevant features.
1010
1111The ` zstd ` package is provided as open source software using a Go standard license.
1212
You can’t perform that action at this time.
0 commit comments