The pages are generated with Goldsv0.8.4. (GOOS=linux GOARCH=amd64)
Golds is a Go 101 project developed by Tapir Liu.
diff --git a/imp/compress/zlib.Resetter.html b/imp/compress/zlib.Resetter.html
index e48c92dd92f..0873d56c00e 100644
--- a/imp/compress/zlib.Resetter.html
+++ b/imp/compress/zlib.Resetter.html
@@ -17,7 +17,7 @@
github.com/klauspost/compress/flate.Resetter.Reset
(*reader).Reset
*compress/flate.decompressor.Reset
- *github.com/klauspost/compress/flate.decompressor.Reset
The pages are generated with Goldsv0.8.4. (GOOS=linux GOARCH=amd64)
Golds is a Go 101 project developed by Tapir Liu.
diff --git a/imp/github.com/gotd/td/mtproto.Handler.html b/imp/github.com/gotd/td/mtproto.Handler.html
index d947269b259..3959c664e2c 100644
--- a/imp/github.com/gotd/td/mtproto.Handler.html
+++ b/imp/github.com/gotd/td/mtproto.Handler.html
@@ -13,7 +13,7 @@
Method Implmentations
Statistics (detailed ones)
- Total 306 packages analyzed and 4757 Go files
- (1580320 lines of code) parsed. On average,
+ Total 306 packages analyzed and 4760 Go files
+ (1581407 lines of code) parsed. On average,
* each Go source file imports 7.16 packages
and contains 332 lines of code.
* each package depends on 6.68 other packages,
- contains 15.84 source code files, and exports
- - 18.65 type names,
+ contains 15.85 source code files, and exports
+ - 18.66 type names,
- 4.29 variables,
- 27.17 constants,
- - 13.49 functions.
-
All Packages (sort packages by: | | | )
3
1. bufio (14) (1269) (10) (4) - implements buffered I/O. It wraps an io.Reader or io.Writer object, creating another object (Reader or Writer) that also implements the interface but provides buffering and some help for textual I/O.
9. context (31) (806) (11) (2) - defines the Context type, which carries deadlines, cancellation signals, and other request-scoped values across API boundaries and between processes.
11. crypto/aes (9) (48) (19) (3) - implements AES encryption (formerly Rijndael), as defined in U.S. Federal Information Processing Standards Publication 197.
3
12. crypto/cipher (17) (1040) (17) (3) - implements standard block cipher modes that can be wrapped around low-level block cipher implementations.
3
13. crypto/des (3) (556) (18) (4) - implements the Data Encryption Standard (DES) and the Triple Data Encryption Algorithm (TDEA) as defined in U.S. Federal Information Processing Standards Publication 46-3.
3
14. crypto/dsa (1) (330) (20) (4) - implements the Digital Signature Algorithm, as defined in FIPS 186-3.
3
15. crypto/ecdh (6) (551) (20) (4) - implements Elliptic Curve Diffie-Hellman over NIST curves and Curve25519.
3
16. crypto/ecdsa (3) (868) (21) (4) - implements the Elliptic Curve Digital Signature Algorithm, as defined in [FIPS 186-5].
18. crypto/elliptic (4) (884) (16) (4) - implements the standard NIST P-224, P-256, P-384, and P-521 elliptic curves over prime fields.
3
19. crypto/fips140 (6) (93) (14) (4) - provides information about the FIPS 140-3 Go Cryptographic Module and FIPS 140-3 mode.
3
20. crypto/hkdf (4) (84) (17) (5) - implements the HMAC-based Extract-and-Expand Key Derivation Function (HKDF) as defined in RFC 5869.
3
21. crypto/hmac (5) (65) (19) (5) - implements the Keyed-Hash Message Authentication Code (HMAC) as defined in U.S. Federal Information Processing Standards Publication 198.
3
22. crypto/hpke (1) (1482) (21) (5) - implements Hybrid Public Key Encryption (HPKE) as defined in [RFC 9180].
25. crypto/internal/boring/sig (1) (17) (1) (4) - holds “code signatures” that can be called and will result in certain code sequences being linked into the final binary.
42. crypto/internal/fips140/mlkem (1) (1573) (16) (6) - implements the quantum-resistant key encapsulation method ML-KEM (formerly known as Kyber), as specified in [NIST FIPS 203].
47. crypto/internal/fips140/sha256 (9) (440) (11) (4) - implements the SHA-224 and SHA-256 hash algorithms as defined in FIPS 180-4.
3
48. crypto/internal/fips140/sha3 (6) (933) (11) (4) - implements the SHA-3 fixed-output-length hash functions and the SHAKE variable-output-length functions defined by [FIPS 202], as well as the cSHAKE extendable-output-length functions defined by [SP 800-185].
3
49. crypto/internal/fips140/sha512 (7) (515) (11) (4) - implements the SHA-384, SHA-512, SHA-512/224, and SHA-512/256 hash algorithms as defined in FIPS 180-4.
52. crypto/internal/fips140/tls13 (1) (215) (15) (5) - implements the TLS 1.3 Key Schedule as specified in RFC 8446, Section 7.1 and allowed by FIPS 140-3 IG 2.4.B Resolution 7.
3
53. crypto/internal/fips140cache (2) (52) (7) (5) - provides a weak map that associates the lifetime of values with the lifetime of keys.
60. crypto/internal/impl (6) (107) (10) (4) - is a registry of alternative implementations of cryptographic primitives, to allow selecting them for testing.
62. crypto/internal/randutil (1) (26) (9) (4) - contains internal randomness utilities for various crypto packages.
3
63. crypto/internal/sysrand (1) (144) (14) (5) - rand provides cryptographically secure random bytes from the operating system.
3
64. crypto/md5 (4) (347) (17) (4) - implements the MD5 hash algorithm as defined in RFC 1321.
3
65. crypto/mlkem (3) (221) (17) (5) - implements the quantum-resistant key encapsulation method ML-KEM (formerly known as Kyber), as specified in [NIST FIPS 203].
3
66. crypto/pbkdf2 (1) (54) (17) (5) - implements the key derivation function PBKDF2 as defined in RFC 8018 (PKCS #5 v2.1).
3
67. crypto/rand (11) (198) (20) (3) - implements a cryptographically secure random number generator.
3
68. crypto/rc4 (2) (83) (17) (5) - implements RC4 encryption, as defined in Bruce Schneier's Applied Cryptography.
3
69. crypto/rsa (7) (1441) (21) (2) - implements RSA encryption as specified in PKCS #1 and RFC 8017.
3
70. crypto/sha1 (6) (413) (19) (3) - implements the SHA-1 hash algorithm as defined in RFC 3174.
3
71. crypto/sha256 (8) (74) (19) (3) - implements the SHA224 and SHA256 hash algorithms as defined in FIPS 180-4.
3
72. crypto/sha3 (3) (274) (12) (4) - implements the SHA-3 hash algorithms and the SHAKE extendable output functions defined in FIPS 202.
3
73. crypto/sha512 (7) (123) (19) (4) - implements the SHA-384, SHA-512, SHA-512/224, and SHA-512/256 hash algorithms as defined in FIPS 180-4.
3
74. crypto/subtle (11) (134) (4) (3) - implements functions that are often useful in cryptographic code but require careful thought to use correctly.
3
75. crypto/tls (2) (14413) (23) (4) - partially implements TLS 1.2, as specified in RFC 5246, and TLS 1.3, as specified in RFC 8446.
77. crypto/x509 (3) (7768) (22) (3) - implements a subset of the X.509 standard.
3
78. crypto/x509/pkix (1) (320) (17) (4) - contains shared, low level structures used for ASN.1 parsing and serialization of X.509 certificates, CRL and OCSP.
3
79. embed (1) (436) (12) (3) - provides access to files embedded in the running Go program.
3
80. encoding (1) (78) (1) (4) - defines interfaces shared by other packages that convert data to and from byte-level and textual representations.
3
81. encoding/asn1 (4) (2107) (16) (4) - implements parsing of DER-encoded ASN.1 data structures, as defined in ITU-T Rec X.690.
3
82. encoding/base64 (14) (665) (9) (3) - implements base64 encoding as specified by RFC 4648.
3
83. encoding/binary (32) (1214) (10) (3) - implements simple translation between numbers and byte sequences and encoding and decoding of varints.
93. github.com/cespare/xxhash/v2 (1) (316) (11) (3) - implements the 64-bit variant of xxHash (XXH64) as described at http://cyan4973.github.io/xxHash/.
103. github.com/gotd/log (8) (460) (15) (1) - defines a minimal, dependency-free logging port for gotd libraries.
3
104. github.com/gotd/neo (1) (538) (15) (2) - implements side effects simulation for testing.
3
105. github.com/gotd/td/ascii (1) (19) (1) (2) - provides data and functions to test some properties of ASCII code points.
3
106. github.com/gotd/td/bin (17) (742) (16) (1) - implements binary serialization and deserialization for TL, providing Buffer that can decode and encode basic Type Language types.
146. github.com/klauspost/compress/gzip (1) (670) (17) (2) - implements reading and writing of gzip format compressed files, as specified in RFC 1952.
3
147. github.com/klauspost/compress/huff0 (1) (2788) (16) (6) - This file contains the specialisation of Decoder.Decompress4X and Decoder.Decompress1X that use an asm implementation of thir main loops.
153. github.com/refraction-networking/utls (1) (25388) (28) (4) - partially implements TLS 1.2, as specified in RFC 5246, and TLS 1.3, as specified in RFC 8446.
180. go.uber.org/atomic (3) (1716) (16) (1) - provides simple wrappers around numerics to enforce atomic access.
3
181. go.uber.org/multierr (9) (694) (15) (1) - allows combining one or more errors together.
3
182. golang.org/x/crypto/chacha20 (1) (453) (18) (6) - implements the ChaCha20 and XChaCha20 encryption algorithms as specified in RFC 8439 and draft-irtf-cfrg-xchacha-01.
3
183. golang.org/x/crypto/chacha20poly1305 (2) (380) (19) (5) - implements the ChaCha20-Poly1305 AEAD and its extended nonce variant XChaCha20-Poly1305, as specified in RFC 8439 and draft-irtf-cfrg-xchacha-01.
3
184. golang.org/x/crypto/cryptobyte (2) (1358) (17) (5) - contains types that help with parsing and constructing length-prefixed, binary messages, including ASN.1 DER.
3
185. golang.org/x/crypto/cryptobyte/asn1 (1) (46) (1) (6) - contains supporting types for parsing and building ASN.1 messages with the cryptobyte package.
3
186. golang.org/x/crypto/hkdf (1) (100) (20) (5) - implements the HMAC-based Extract-and-Expand Key Derivation Function (HKDF) as defined in RFC 5869.
192. golang.org/x/net/proxy (1) (429) (16) (1) - provides support for a variety of protocols to proxy network data.
3
193. golang.org/x/sync/errgroup (1) (151) (15) (2) - provides synchronization, error propagation, and Context cancellation for groups of goroutines working on subtasks of a common task.
212. internal/godebug (13) (316) (8) (3) - makes the settings in the $GODEBUG environment variable available to other packages.
3
213. internal/godebugs (2) (114) (1) (4) - provides a table of known GODEBUG settings, for use by a variety of other packages, including internal/godebug, runtime, runtime/metrics, and cmd/go/internal/load.
3
214. internal/goexperiment (1) (291) (1) (4) - implements support for toolchain experiments.
216. internal/msan (2) (37) (2) (4) - contains helper functions for manually instrumenting code for the memory sanitizer.
3
217. internal/nettrace (2) (46) (1) (4) - contains internal hooks for tracing activity in the net package.
3
218. internal/oserror (2) (18) (8) (4) - defines errors values used in the os package.
3
219. internal/poll (3) (2390) (11) (3) - supports non-blocking I/O on file descriptors with polling.
3
220. internal/profilerecord (1) (28) (1) (4) - holds internal types used to represent profiling records with deep stack traces.
3
221. internal/race (6) (66) (3) (3) - contains helper functions for manually instrumenting code for the race detector.
3
222. internal/reflectlite (3) (1201) (6) (3) - implements lightweight version of reflect, not using any package except for "runtime", "unsafe", and "internal/abi"
3
223. internal/runtime/atomic (2) (876) (2) (4) - provides atomic operations, independent of sync/atomic, to the runtime.
236. internal/stringslite (10) (150) (4) (3) - implements a subset of strings, only using packages that may be imported by "os".
3
237. internal/sync (2) (1010) (4) (3) - provides basic synchronization primitives such as mutual exclusion locks to internal packages (including ones that depend on sync).
3
238. internal/synctest (1) (105) (3) (3) - provides support for testing concurrent code.
241. internal/testlog (1) (113) (7) (3) - provides a back-channel communication path between tests and package os, so that cmd/go can see which environment variables and files a test consults.
3
242. internal/trace/tracev2 (1) (707) (1) (4) - contains definitions for the v2 execution trace wire format.
3
243. internal/unsafeheader (2) (37) (2) (4) - contains header declarations for the Go runtime's slice and string implementations.
252. math/bits (49) (693) (2) (2) - implements bit counting and manipulation functions for the predeclared unsigned integer types.
3
253. math/rand (4) (1265) (9) (3) - implements pseudo-random number generators suitable for tasks such as simulation, but it should not be used for security-sensitive work.
3
254. math/rand/v2 (2) (1046) (8) (5) - implements pseudo-random number generators suitable for tasks such as simulation, but it should not be used for security-sensitive work.
3
255. mime (2) (1295) (15) (4) - implements parts of the MIME spec.
3
256. mime/multipart (1) (1023) (21) (4) - implements MIME multipart parsing, as defined in RFC 2046.
3
257. mime/quotedprintable (1) (312) (15) (5) - implements quoted-printable encoding as specified by RFC 2045.
3
258. net (19) (12982) (14) (3) - provides a portable interface for network I/O, including TCP/IP, UDP, domain name resolution, and Unix domain sockets.
3
259. net/http (3) (29491) (26) (3) - provides HTTP client and server implementations.
3
260. net/http/httptrace (2) (255) (24) (4) - provides mechanisms to trace the events within HTTP client requests.
3
261. net/http/internal (1) (300) (15) (4) - contains HTTP internals shared by net/http and net/http/httputil.
269. path/filepath (5) (1039) (14) (2) - implements utility routines for manipulating filename paths in a way compatible with the target operating system-defined file paths.
3
270. reflect (15) (8694) (9) (3) - implements run-time reflection, allowing a program to manipulate objects with arbitrary types.
3
271. rsc.io/qr (1) (516) (16) (2) - encodes QR codes.
283. syscall (9) (8451) (9) (3) - contains an interface to the low-level operating system primitives.
3
284. time (45) (5623) (10) (2) - provides functionality for measuring and displaying time.
3
285. unicode (8) (10330) (1) (3) - provides data and functions to test some properties of Unicode code points.
3
286. unicode/utf16 (4) (144) (1) (3) - implements encoding and decoding of UTF-16 sequences.
3
287. unicode/utf8 (25) (578) (1) (3) - implements functions and constants to support text encoded in UTF-8.
3
288. unique (1) (552) (7) (4) - The unique package provides facilities for canonicalizing ("interning") comparable values.
3
289. unsafe (81) (271) (1) (3) - contains operations that step around the type safety of Go programs.
3
290. vendor/golang.org/x/crypto/chacha20 (1) (453) (18) (6) - implements the ChaCha20 and XChaCha20 encryption algorithms as specified in RFC 8439 and draft-irtf-cfrg-xchacha-01.
3
291. vendor/golang.org/x/crypto/chacha20poly1305 (2) (380) (19) (5) - implements the ChaCha20-Poly1305 AEAD and its extended nonce variant XChaCha20-Poly1305, as specified in RFC 8439 and draft-irtf-cfrg-xchacha-01.
3
292. vendor/golang.org/x/crypto/cryptobyte (3) (1358) (17) (4) - contains types that help with parsing and constructing length-prefixed, binary messages, including ASN.1 DER.
298. vendor/golang.org/x/net/http/httpproxy (1) (373) (19) (4) - provides support for HTTP proxy determination based on environment variables, as provided by net/http's ProxyFromEnvironment function.
3
299. vendor/golang.org/x/net/http2/hpack (2) (1585) (15) (4) - implements HPACK, a compression format for efficiently representing HTTP header fields in the context of HTTP/2.
3
300. vendor/golang.org/x/net/idna (3) (6341) (18) (4) - implements IDNA2008 using the compatibility processing defined by UTS (Unicode Technical Standard) #46, which defines a standard to deal with the transition from IDNA2003.
3
301. vendor/golang.org/x/sys/cpu (1) (759) (14) (6) - implements processor feature detection for various CPU architectures.
303. vendor/golang.org/x/text/transform (2) (709) (10) (6) - provides reader and writer wrappers that transform the bytes passing through as well as various transformations.
306. weak (4) (107) (6) (5) - provides ways to safely reference memory weakly, that is, without preventing its reclamation.
+ - 13.50 functions.
+
All Packages (sort packages by: | | | )
3
1. bufio (14) (1269) (10) (4) - implements buffered I/O. It wraps an io.Reader or io.Writer object, creating another object (Reader or Writer) that also implements the interface but provides buffering and some help for textual I/O.
9. context (31) (806) (11) (2) - defines the Context type, which carries deadlines, cancellation signals, and other request-scoped values across API boundaries and between processes.
11. crypto/aes (9) (48) (19) (3) - implements AES encryption (formerly Rijndael), as defined in U.S. Federal Information Processing Standards Publication 197.
3
12. crypto/cipher (17) (1040) (17) (3) - implements standard block cipher modes that can be wrapped around low-level block cipher implementations.
3
13. crypto/des (3) (556) (18) (4) - implements the Data Encryption Standard (DES) and the Triple Data Encryption Algorithm (TDEA) as defined in U.S. Federal Information Processing Standards Publication 46-3.
3
14. crypto/dsa (1) (330) (20) (4) - implements the Digital Signature Algorithm, as defined in FIPS 186-3.
3
15. crypto/ecdh (6) (551) (20) (4) - implements Elliptic Curve Diffie-Hellman over NIST curves and Curve25519.
3
16. crypto/ecdsa (3) (868) (21) (4) - implements the Elliptic Curve Digital Signature Algorithm, as defined in [FIPS 186-5].
18. crypto/elliptic (4) (884) (16) (4) - implements the standard NIST P-224, P-256, P-384, and P-521 elliptic curves over prime fields.
3
19. crypto/fips140 (6) (93) (14) (4) - provides information about the FIPS 140-3 Go Cryptographic Module and FIPS 140-3 mode.
3
20. crypto/hkdf (4) (84) (17) (5) - implements the HMAC-based Extract-and-Expand Key Derivation Function (HKDF) as defined in RFC 5869.
3
21. crypto/hmac (5) (65) (19) (5) - implements the Keyed-Hash Message Authentication Code (HMAC) as defined in U.S. Federal Information Processing Standards Publication 198.
3
22. crypto/hpke (1) (1482) (21) (5) - implements Hybrid Public Key Encryption (HPKE) as defined in [RFC 9180].
25. crypto/internal/boring/sig (1) (17) (1) (4) - holds “code signatures” that can be called and will result in certain code sequences being linked into the final binary.
42. crypto/internal/fips140/mlkem (1) (1573) (16) (6) - implements the quantum-resistant key encapsulation method ML-KEM (formerly known as Kyber), as specified in [NIST FIPS 203].
47. crypto/internal/fips140/sha256 (9) (440) (11) (4) - implements the SHA-224 and SHA-256 hash algorithms as defined in FIPS 180-4.
3
48. crypto/internal/fips140/sha3 (6) (933) (11) (4) - implements the SHA-3 fixed-output-length hash functions and the SHAKE variable-output-length functions defined by [FIPS 202], as well as the cSHAKE extendable-output-length functions defined by [SP 800-185].
3
49. crypto/internal/fips140/sha512 (7) (515) (11) (4) - implements the SHA-384, SHA-512, SHA-512/224, and SHA-512/256 hash algorithms as defined in FIPS 180-4.
52. crypto/internal/fips140/tls13 (1) (215) (15) (5) - implements the TLS 1.3 Key Schedule as specified in RFC 8446, Section 7.1 and allowed by FIPS 140-3 IG 2.4.B Resolution 7.
3
53. crypto/internal/fips140cache (2) (52) (7) (5) - provides a weak map that associates the lifetime of values with the lifetime of keys.
60. crypto/internal/impl (6) (107) (10) (4) - is a registry of alternative implementations of cryptographic primitives, to allow selecting them for testing.
62. crypto/internal/randutil (1) (26) (9) (4) - contains internal randomness utilities for various crypto packages.
3
63. crypto/internal/sysrand (1) (144) (14) (5) - rand provides cryptographically secure random bytes from the operating system.
3
64. crypto/md5 (4) (347) (17) (4) - implements the MD5 hash algorithm as defined in RFC 1321.
3
65. crypto/mlkem (3) (221) (17) (5) - implements the quantum-resistant key encapsulation method ML-KEM (formerly known as Kyber), as specified in [NIST FIPS 203].
3
66. crypto/pbkdf2 (1) (54) (17) (5) - implements the key derivation function PBKDF2 as defined in RFC 8018 (PKCS #5 v2.1).
3
67. crypto/rand (11) (198) (20) (3) - implements a cryptographically secure random number generator.
3
68. crypto/rc4 (2) (83) (17) (5) - implements RC4 encryption, as defined in Bruce Schneier's Applied Cryptography.
3
69. crypto/rsa (7) (1441) (21) (2) - implements RSA encryption as specified in PKCS #1 and RFC 8017.
3
70. crypto/sha1 (6) (413) (19) (3) - implements the SHA-1 hash algorithm as defined in RFC 3174.
3
71. crypto/sha256 (8) (74) (19) (3) - implements the SHA224 and SHA256 hash algorithms as defined in FIPS 180-4.
3
72. crypto/sha3 (3) (274) (12) (4) - implements the SHA-3 hash algorithms and the SHAKE extendable output functions defined in FIPS 202.
3
73. crypto/sha512 (7) (123) (19) (4) - implements the SHA-384, SHA-512, SHA-512/224, and SHA-512/256 hash algorithms as defined in FIPS 180-4.
3
74. crypto/subtle (11) (134) (4) (3) - implements functions that are often useful in cryptographic code but require careful thought to use correctly.
3
75. crypto/tls (2) (14413) (23) (4) - partially implements TLS 1.2, as specified in RFC 5246, and TLS 1.3, as specified in RFC 8446.
77. crypto/x509 (3) (7768) (22) (3) - implements a subset of the X.509 standard.
3
78. crypto/x509/pkix (1) (320) (17) (4) - contains shared, low level structures used for ASN.1 parsing and serialization of X.509 certificates, CRL and OCSP.
3
79. embed (1) (436) (12) (3) - provides access to files embedded in the running Go program.
3
80. encoding (1) (78) (1) (4) - defines interfaces shared by other packages that convert data to and from byte-level and textual representations.
3
81. encoding/asn1 (4) (2107) (16) (4) - implements parsing of DER-encoded ASN.1 data structures, as defined in ITU-T Rec X.690.
3
82. encoding/base64 (14) (665) (9) (3) - implements base64 encoding as specified by RFC 4648.
3
83. encoding/binary (32) (1214) (10) (3) - implements simple translation between numbers and byte sequences and encoding and decoding of varints.
93. github.com/cespare/xxhash/v2 (1) (316) (11) (3) - implements the 64-bit variant of xxHash (XXH64) as described at http://cyan4973.github.io/xxHash/.
103. github.com/gotd/log (8) (460) (15) (1) - defines a minimal, dependency-free logging port for gotd libraries.
3
104. github.com/gotd/neo (1) (538) (15) (2) - implements side effects simulation for testing.
3
105. github.com/gotd/td/ascii (1) (19) (1) (2) - provides data and functions to test some properties of ASCII code points.
3
106. github.com/gotd/td/bin (17) (742) (16) (1) - implements binary serialization and deserialization for TL, providing Buffer that can decode and encode basic Type Language types.
146. github.com/klauspost/compress/gzip (1) (670) (17) (2) - implements reading and writing of gzip format compressed files, as specified in RFC 1952.
3
147. github.com/klauspost/compress/huff0 (1) (2956) (16) (6) - This file contains the specialisation of Decoder.Decompress4X and Decoder.Decompress1X that use an asm implementation of thir main loops.
153. github.com/refraction-networking/utls (1) (25388) (28) (4) - partially implements TLS 1.2, as specified in RFC 5246, and TLS 1.3, as specified in RFC 8446.
180. go.uber.org/atomic (3) (1716) (16) (1) - provides simple wrappers around numerics to enforce atomic access.
3
181. go.uber.org/multierr (9) (694) (15) (1) - allows combining one or more errors together.
3
182. golang.org/x/crypto/chacha20 (1) (453) (18) (6) - implements the ChaCha20 and XChaCha20 encryption algorithms as specified in RFC 8439 and draft-irtf-cfrg-xchacha-01.
3
183. golang.org/x/crypto/chacha20poly1305 (2) (380) (19) (5) - implements the ChaCha20-Poly1305 AEAD and its extended nonce variant XChaCha20-Poly1305, as specified in RFC 8439 and draft-irtf-cfrg-xchacha-01.
3
184. golang.org/x/crypto/cryptobyte (2) (1358) (17) (5) - contains types that help with parsing and constructing length-prefixed, binary messages, including ASN.1 DER.
3
185. golang.org/x/crypto/cryptobyte/asn1 (1) (46) (1) (6) - contains supporting types for parsing and building ASN.1 messages with the cryptobyte package.
3
186. golang.org/x/crypto/hkdf (1) (100) (20) (5) - implements the HMAC-based Extract-and-Expand Key Derivation Function (HKDF) as defined in RFC 5869.
192. golang.org/x/net/proxy (1) (429) (16) (1) - provides support for a variety of protocols to proxy network data.
3
193. golang.org/x/sync/errgroup (1) (151) (15) (2) - provides synchronization, error propagation, and Context cancellation for groups of goroutines working on subtasks of a common task.
212. internal/godebug (13) (316) (8) (3) - makes the settings in the $GODEBUG environment variable available to other packages.
3
213. internal/godebugs (2) (114) (1) (4) - provides a table of known GODEBUG settings, for use by a variety of other packages, including internal/godebug, runtime, runtime/metrics, and cmd/go/internal/load.
3
214. internal/goexperiment (1) (291) (1) (4) - implements support for toolchain experiments.
216. internal/msan (2) (37) (2) (4) - contains helper functions for manually instrumenting code for the memory sanitizer.
3
217. internal/nettrace (2) (46) (1) (4) - contains internal hooks for tracing activity in the net package.
3
218. internal/oserror (2) (18) (8) (4) - defines errors values used in the os package.
3
219. internal/poll (3) (2390) (11) (3) - supports non-blocking I/O on file descriptors with polling.
3
220. internal/profilerecord (1) (28) (1) (4) - holds internal types used to represent profiling records with deep stack traces.
3
221. internal/race (6) (66) (3) (3) - contains helper functions for manually instrumenting code for the race detector.
3
222. internal/reflectlite (3) (1201) (6) (3) - implements lightweight version of reflect, not using any package except for "runtime", "unsafe", and "internal/abi"
3
223. internal/runtime/atomic (2) (876) (2) (4) - provides atomic operations, independent of sync/atomic, to the runtime.
236. internal/stringslite (10) (150) (4) (3) - implements a subset of strings, only using packages that may be imported by "os".
3
237. internal/sync (2) (1010) (4) (3) - provides basic synchronization primitives such as mutual exclusion locks to internal packages (including ones that depend on sync).
3
238. internal/synctest (1) (105) (3) (3) - provides support for testing concurrent code.
241. internal/testlog (1) (113) (7) (3) - provides a back-channel communication path between tests and package os, so that cmd/go can see which environment variables and files a test consults.
3
242. internal/trace/tracev2 (1) (707) (1) (4) - contains definitions for the v2 execution trace wire format.
3
243. internal/unsafeheader (2) (37) (2) (4) - contains header declarations for the Go runtime's slice and string implementations.
252. math/bits (49) (693) (2) (2) - implements bit counting and manipulation functions for the predeclared unsigned integer types.
3
253. math/rand (4) (1265) (9) (3) - implements pseudo-random number generators suitable for tasks such as simulation, but it should not be used for security-sensitive work.
3
254. math/rand/v2 (2) (1046) (8) (5) - implements pseudo-random number generators suitable for tasks such as simulation, but it should not be used for security-sensitive work.
3
255. mime (2) (1295) (15) (4) - implements parts of the MIME spec.
3
256. mime/multipart (1) (1023) (21) (4) - implements MIME multipart parsing, as defined in RFC 2046.
3
257. mime/quotedprintable (1) (312) (15) (5) - implements quoted-printable encoding as specified by RFC 2045.
3
258. net (19) (12982) (14) (3) - provides a portable interface for network I/O, including TCP/IP, UDP, domain name resolution, and Unix domain sockets.
3
259. net/http (3) (29491) (26) (3) - provides HTTP client and server implementations.
3
260. net/http/httptrace (2) (255) (24) (4) - provides mechanisms to trace the events within HTTP client requests.
3
261. net/http/internal (1) (300) (15) (4) - contains HTTP internals shared by net/http and net/http/httputil.
269. path/filepath (5) (1039) (14) (2) - implements utility routines for manipulating filename paths in a way compatible with the target operating system-defined file paths.
3
270. reflect (15) (8694) (9) (3) - implements run-time reflection, allowing a program to manipulate objects with arbitrary types.
3
271. rsc.io/qr (1) (516) (16) (2) - encodes QR codes.
283. syscall (9) (8451) (9) (3) - contains an interface to the low-level operating system primitives.
3
284. time (45) (5623) (10) (2) - provides functionality for measuring and displaying time.
3
285. unicode (8) (10330) (1) (3) - provides data and functions to test some properties of Unicode code points.
3
286. unicode/utf16 (4) (144) (1) (3) - implements encoding and decoding of UTF-16 sequences.
3
287. unicode/utf8 (25) (578) (1) (3) - implements functions and constants to support text encoded in UTF-8.
3
288. unique (1) (552) (7) (4) - The unique package provides facilities for canonicalizing ("interning") comparable values.
3
289. unsafe (81) (271) (1) (3) - contains operations that step around the type safety of Go programs.
3
290. vendor/golang.org/x/crypto/chacha20 (1) (453) (18) (6) - implements the ChaCha20 and XChaCha20 encryption algorithms as specified in RFC 8439 and draft-irtf-cfrg-xchacha-01.
3
291. vendor/golang.org/x/crypto/chacha20poly1305 (2) (380) (19) (5) - implements the ChaCha20-Poly1305 AEAD and its extended nonce variant XChaCha20-Poly1305, as specified in RFC 8439 and draft-irtf-cfrg-xchacha-01.
3
292. vendor/golang.org/x/crypto/cryptobyte (3) (1358) (17) (4) - contains types that help with parsing and constructing length-prefixed, binary messages, including ASN.1 DER.
298. vendor/golang.org/x/net/http/httpproxy (1) (373) (19) (4) - provides support for HTTP proxy determination based on environment variables, as provided by net/http's ProxyFromEnvironment function.
3
299. vendor/golang.org/x/net/http2/hpack (2) (1585) (15) (4) - implements HPACK, a compression format for efficiently representing HTTP header fields in the context of HTTP/2.
3
300. vendor/golang.org/x/net/idna (3) (6341) (18) (4) - implements IDNA2008 using the compatibility processing defined by UTS (Unicode Technical Standard) #46, which defines a standard to deal with the transition from IDNA2003.
3
301. vendor/golang.org/x/sys/cpu (1) (759) (14) (6) - implements processor feature detection for various CPU architectures.
303. vendor/golang.org/x/text/transform (2) (709) (10) (6) - provides reader and writer wrappers that transform the bytes passing through as well as various transformations.
+ peekID returns the type id of an encodable message for logging, or 0 if it
+ cannot be determined without encoding.
+
+
vendoredKeys parses vendored file _data/public_keys.pem as list of
PEM-encoded public RSA keys.
@@ -447,7 +451,7 @@
ErrPFSReconnectRequired is returned when connection should be recreated
to continue PFS flow (e.g. temp key renewal).
-
Telegram recommends short-lived temp keys; we keep 24h as practical
default to balance reconnect frequency and security.
@@ -477,6 +481,13 @@
Prevent obviously invalid ttl values that can break renewal math.
+
+ slowWriteThreshold is the duration after which a single write (lock
+ acquisition + encrypt + transport send) is considered suspiciously slow and
+ logged at warning level. A blocked or slow write is the primary signature of
+ a half-open connection where updates are still received but requests can no
+ longer be issued.
+
The pages are generated with Goldsv0.8.4. (GOOS=linux GOARCH=amd64)
diff --git a/pkg/github.com/gotd/td/rpc.html b/pkg/github.com/gotd/td/rpc.html
index cd0452a9bc3..0cc740f39ca 100644
--- a/pkg/github.com/gotd/td/rpc.html
+++ b/pkg/github.com/gotd/td/rpc.html
@@ -57,7 +57,7 @@
sendSendwgsync.WaitGroup
-
+ Close gracefully closes the engine.
All pending requests will be awaited.
All Do method calls of closed engine will return ErrEngineClosed error.
@@ -66,7 +66,7 @@
Do sends request to server and blocks until response is received, performing
multiple retries if needed.
-
+ ForceClose forcibly closes the engine.
All pending requests will be canceled.
All Do method calls of closed engine will return ErrEngineClosed error.
@@ -74,15 +74,15 @@
NotifyAcks notifies engine about received acknowledgements.
-
+ NotifyError notifies engine about received RPC error.
-
+ NotifyResult notifies engine about received RPC response.(*Engine) removeAck(id int64)
-
+ retryUntilAck resends the request to the server until request is
acknowledged.
@@ -119,7 +119,7 @@
func NopDrop(Request) error
func (*Engine).Do(ctx context.Context, req Request) error
- func (*Engine).retryUntilAck(ctx context.Context, req Request) (sent bool, err error)
+ func (*Engine).retryUntilAck(ctx context.Context, req Request) (sent bool, err error)
func github.com/gotd/td/mtproto.(*Conn).dropRPC(req Request) error
Decompress state.
-
-
+
+ Input bits, in top of b.
@@ -543,9 +567,12 @@
Temporary buffer (avoids repeated allocation).
+ cbfunc(InflateCheckpoint)codebits*[19]intcopyDistintcopyLenint
+ cpInflateCheckpoint
+ cpBuf[]byte Output history, buffer.
@@ -557,6 +584,9 @@
Huffman decoders for literal/length, distance.
+
+
+ // WithResumeFrom was suppliedhd*huffmanDecoderhl*huffmanDecoder
@@ -570,25 +600,38 @@
and decompression state.stepStateint
- toRead[]byte
-
- (*decompressor) Close() error
- (*decompressor) Read(b []byte) (int, error)
- (*decompressor) Reset(r io.Reader, dict []byte) error
-
+ toRead[]byte
+
+ // baseline uncompressed offset (from a resume checkpoint)
+
+
+ (*decompressor) Close() error
+ (*decompressor) Read(b []byte) (int, error)
+ (*decompressor) Reset(r io.Reader, dict []byte) error
+
+ ResetCP will adjust the input to the provided checkpoint.
+ It is assumed the input stream is forwarded to cp.CompressedOffset.
+
+ WriteTo implements the io.WriteTo interface for io.Copy and friends.
-
-
+
+
+ applyCP seeds the decompressor state from a resume checkpoint:
+ loads the sliding window, sets the absolute compressed/uncompressed
+ offsets, and skips cp.BitOffset bits into the first input byte so
+ the next decode aligns with the start of a deflate block.
+
+ copyData copies f.copyLen bytes from the underlying reader into f.hist.
It pauses for reads when f.hist is full.
-
+ Copy a single uncompressed data block from input to output.
- (*decompressor) doStep()
- (*decompressor) finishBlock()
-
+ (*decompressor) doStep()
+ (*decompressor) finishBlock()
+ Read the next Huffman-encoded symbol from f according to h.(*decompressor) huffmanBlockDecoder()
@@ -622,9 +665,9 @@
and the distance values, respectively. If hd == nil, using the
fixed distance encoding associated with fixed Huffman blocks.
- (*decompressor) moreBits() error
- (*decompressor) nextBlock()
- (*decompressor) readHuffman() error
+ (*decompressor) moreBits() error
+ (*decompressor) nextBlock()
+ (*decompressor) readHuffman() error
*decompressor : Resetter
*decompressor : compress/flate.Resetter
@@ -634,7 +677,7 @@
*decompressor : io.Reader
*decompressor : io.WriterTo
-
+
dictDecoder implements the LZ77 sliding dictionary as used in decompression.
LZ77 decompresses data through sequences of two forms of commands:
@@ -656,9 +699,12 @@
checks about the arguments. As such, the invariants documented for each
method call must be respected.
-
-
-
+
+
+
+ // Total bytes returned by readFlush since init
+
+ // Has a full window length been written yet?
@@ -671,28 +717,36 @@
Invariant: 0 <= rdPos <= wrPos <= len(hist) // Current output position in buffer
-
-
-
+
+
+
+ appendWindow appends the current sliding window (up to len(hist) most recent
+ bytes, oldest first) to dst.
+
+ availRead reports the number of bytes that can be flushed by readFlush.
-
+ availWrite reports the available amount of output buffer space.
-
+
+ decoded reports the total number of bytes written into the dictionary since
+ init (i.e. excluding any preset dict bytes).
+
+ histSize reports the total amount of historical data in the dictionary.
-
+ init initializes dictDecoder to have a sliding window dictionary of the given
size. If a preset dict is provided, it will initialize the dictionary with
the contents of dict.
-
+ readFlush returns a slice of the historical buffer that is ready to be
emitted to the user. The data returned by readFlush must be fully consumed
before calling any other dictDecoder methods.
-
+ tryWriteCopy tries to copy a string at a given (distance, length) to the
output. This specialized version is optimized for short distances.
@@ -700,24 +754,24 @@
This invariant must be kept: 0 < dist <= histSize()
-
+ writeByte writes a single byte to the dictionary.
This invariant must be kept: 0 < availWrite()
-
+ writeCopy copies a string at a given (dist, length) to the output.
This returns the number of bytes copied and may be less than the requested
length if the available space in the output buffer is too small.
This invariant must be kept: 0 < dist <= histSize()
-
+ writeMark advances the writer pointer by cnt.
This invariant must be kept: 0 <= cnt <= availWrite()
-
+ writeSlice returns a slice of the available buffer to write data to.
This invariant will be kept: len(s) <= availWrite()
@@ -1390,9 +1444,9 @@
func statelessEnc(dst *tokens, src []byte, startAt int16)
-
Package-Level Functions (total 56, in which 10 are exported)
+
Package-Level Functions (total 58, in which 12 are exported)
-
+
NewReader returns a new ReadCloser that can be used
to read the uncompressed version of r.
If r does not also implement io.ByteReader,
@@ -1402,7 +1456,7 @@
The ReadCloser returned by NewReader also implements Resetter.
-
+
NewReaderDict is like NewReader but initializes the reader
with a preset dictionary. The returned Reader behaves as if
the uncompressed data stream started with the given dictionary,
@@ -1411,7 +1465,7 @@
The ReadCloser returned by NewReader also implements Resetter.
-
+
NewReaderOpts returns new reader with provided options
@@ -1454,13 +1508,25 @@
Longer dictionaries will be truncated and will still produce valid output.
Sending nil dictionary is perfectly fine.
-
+
WithDict initializes the reader with a preset dictionary
-
+
+ WithEobCallback will call the provided function after each block
+ with the current gzip checkpoint.
+ After returning the provided window can no longer be referenced.
+ The callback will not be triggered after a block is marked "final".
+ The callback is not retained after Reset.
+
+
WithPartialBlock tells decompressor to return after each block,
so it can read data written with partial flush
+
+ WithResumeFrom will adjust the input to the provided checkpoint.
+ It is assumed the input stream is forwarded to the provided offset.
+ The checkpoint is removed when Reset is called.
+
atLeastOne clamps the result between 1 and 15.
@@ -1471,7 +1537,7 @@
Initialize the fixedHuffmanDecoder only once upon first use.
diff --git a/pkg/github.com/klauspost/compress/huff0.html b/pkg/github.com/klauspost/compress/huff0.html
index 772f05155b2..290a5344aa8 100644
--- a/pkg/github.com/klauspost/compress/huff0.html
+++ b/pkg/github.com/klauspost/compress/huff0.html
@@ -21,13 +21,14 @@
bitreader.gobitwriter.go
+ build_table.gocompress.godecompress.go
-
+ This file contains the specialisation of Decoder.Decompress4X
and Decoder.Decompress1X that use an asm implementation of thir main loops.
-
+ Package huff0 provides fast huffman encoding as used in zstd.
See README.md at https://github.com/klauspost/compress/tree/master/huff0 for details.
@@ -90,7 +91,7 @@
const ReusePolicyNone
const ReusePolicyPrefer
-
+
@@ -163,7 +164,31 @@
// Length of active part of the symbol table.tmpOut[4][]byte
-
+
+
+ AppendTable serializes the table currently stored in prevTable (e.g. as
+ installed by BuildCTable or carried over from a previous Compress call)
+ into a self-delimiting zstd-style header and appends it to dst. The
+ returned slice can be parsed back by ReadTable.
+
+
+ BuildCTable builds a Huffman compression table from a precomputed symbol
+ histogram and installs it as the previous (reuse) table on s.
+
+ After this call:
+ - EstimateSize/CanUseTable can probe the table against other histograms.
+ - Compress1X/Compress4X with Reuse = ReusePolicyMust will encode without
+ emitting a new table header.
+ - TransferCTable can hand the table to a sibling Scratch.
+
+ count[i] is the number of occurrences of symbol i. The histogram must have
+ at least 2 distinct non-zero symbols; ErrUseRLE is returned for a single
+ symbol and an error is returned for an empty histogram.
+
+
+ CanUseTable reports whether the table in prevTable can encode every
+ non-zero symbol present in hist.
+ Decoder will return a stateless decoder that can be used by multiple
decompressors concurrently.
@@ -185,6 +210,12 @@
The length of the supplied input must match the end of a block exactly.
The destination size of the uncompressed data must be known and provided.
deprecated: Use the stateless Decoder() to get a concurrent version.
+
+
+ EstimateSize returns an estimated compressed payload size in bytes for the
+ supplied histogram using the table currently stored in prevTable. It returns
+ -1 when the table cannot encode every non-zero symbol of hist (i.e. when
+ CanUseTable would return false). The estimate excludes the table header. TransferCTable will transfer the previously used compression table.
diff --git a/pkg/github.com/klauspost/compress/zstd.html b/pkg/github.com/klauspost/compress/zstd.html
index 350f3f28e59..048d8631583 100644
--- a/pkg/github.com/klauspost/compress/zstd.html
+++ b/pkg/github.com/klauspost/compress/zstd.html
@@ -35,12 +35,13 @@
enc_better.goenc_dfast.goenc_fast.go
+ enc_jobs.goencoder.goencoder_options.goframedec.goframeenc.gofse_decoder.go
- fse_decoder_amd64.go
+ fse_decoder_asm.gofse_encoder.gofse_predefined.gohash.go
@@ -48,11 +49,12 @@
matchlen_amd64.goseqdec.goseqdec_amd64.go
+ seqdec_asm.goseqenc.gosimple_go124.gosnappy.gozip.go
-
+ Package zstd provides decompression of zstandard files.
For advanced usage and examples, go to the README: https://github.com/klauspost/compress/tree/master/zstd#zstd
@@ -109,7 +111,7 @@
}
-
Package-Level Type Names (total 64, in which 8 are exported)
+
Package-Level Type Names (total 66, in which 8 are exported)
Encoder provides encoding to Zstandard.
An Encoder can be used for either compressing a stream via the
io.WriteCloser interface supported by the Encoder or as multiple independent
@@ -271,13 +273,13 @@
initsync.OnceoencoderOptionsstateencoderState
-
-
+
+ Close will flush the final output and close the stream.
The function will block until everything has been written.
The Encoder can still be re-used after calling this.
-
+ EncodeAll will encode all input in src and append it to dst.
This function can be called concurrently, but each call will only run on a single goroutine.
If empty input is given, nothing is returned, unless WithZeroFrames is specified.
@@ -285,53 +287,67 @@
Data compressed with EncodeAll can be decoded with the Decoder,
using either a stream or DecodeAll.
-
+ Flush will send the currently written data to output
and block until everything has been written.
This should only be used on rare occasions where pushing the currently queued data is critical.
-
+ MaxEncodedSize returns the expected maximum
size of an encoded block or stream.
-
+ ReadFrom reads data from r until EOF or error.
The return value n is the number of bytes read.
Any error except io.EOF encountered during the read is also returned.
The Copy function uses ReaderFrom if available.
-
+ Reset will re-initialize the writer and new writes will encode to the supplied writer
as a new, independent stream.
-
+ ResetContentSize will reset and set a content size for the next stream.
If the bytes written does not match the size given an error will be returned
when calling Close().
This is removed when Reset is called.
Sizes <= 0 results in no content size set.
-
+ ResetWithOptions will re-initialize the writer and apply the given options
as a new, independent stream.
Options are applied on top of the existing options.
Some options cannot be changed on reset and will return an error.
-
+ Write data to the encoder.
Input data will be buffered and as the buffer fills up
content will be compressed and written to the output.
When done writing, use Close to flush the remaining output
and write CRC if requested.
-
- (*Encoder) encodeAll(enc encoder, src, dst []byte) []byte
- (*Encoder) initialize()
-
+
+ (*Encoder) closeJobs() error
+ (*Encoder) compressJob(enc encoder, job *encJob)
+ (*Encoder) dispatchJob(final bool) error
+ (*Encoder) encodeAll(enc encoder, src, dst []byte) []byte
+ (*Encoder) flushJobs() error
+ (*Encoder) initialize()
+ (*Encoder) jobFlusher()
+ (*Encoder) jobWorker()
+ nextBlock will synchronize and start compressing input in e.state.filling.
If an error has occurred during encoding it will be returned.
-
+
+ (*Encoder) readFromJobs(r io.Reader) (n int64, err error)
+ (*Encoder) shutdownJobWorkers()
+ (*Encoder) startJobWorkers()
+
+ waitAllJobs blocks until all dispatched jobs have been flushed.
+
+ (*Encoder) writeBlocks(p []byte) (n int, err error)
+ (*Encoder) writeJobs(p []byte) (n int, err error)
*Encoder : internal/bisect.Writer
*Encoder : io.Closer
@@ -344,14 +360,14 @@
func NewWriter(w io.Writer, opts ...EOption) (*Encoder, error)
-
+
EncoderLevel predefines encoder compression levels.
Only use the constants made available, since the actual mapping
of these values are very likely to change and your compression could change
unpredictably when upgrading the library.
-
+ String provides a string representation of the compression level.
@@ -373,11 +389,12 @@
const speedLast
const speedNotSet
-
Header contains information about the first frame and block within that.
@@ -499,7 +516,7 @@
(*SnappyConverter) readFull(p []byte, allowEOF bool) (ok bool)
-
bestFastEncoder uses 2 tables, one for short matches (5 bytes) and one for long matches.
The long match table contains the previous entry with the same hash,
effectively making it a "chain" of length 2.
@@ -539,7 +556,7 @@
fastBase.tmp[8]bytelongTable[4194304]prevEntrytable[262144]prevEntry
-
+ AppendCRC will append the CRC to the destination slice and return it.
@@ -560,6 +577,7 @@
Reset will reset and set a dictionary if not nil
+ (*bestFastEncoder) ResetPrefix(prefix []byte) useBlock will replace the block with the provided one,
but transfer recent offsets from the previous.
@@ -568,20 +586,25 @@
WindowSize returns the window size of the encoder,
or a window size small enough to contain the input size, if > 0.
-
+ (*bestFastEncoder) addBlock(src []byte) int32 ensureHist will ensure that history can keep at least this many bytes.(*bestFastEncoder) matchlen(s, t int32, src []byte) int32
-
+ Reset the encoding table.
+
+
+ resetBasePrefix resets the encoder state and loads prefix as initial history.
+ This is used for parallel job encoding where non-first jobs need overlap context.
+ Rep offsets are set to defaults [1,4,8] (invalidated, matching C behavior).
*bestFastEncoder : encoder
-
+
betterFastEncoder uses 2 tables, one for short matches (5 bytes) and one for long matches.
The long match table contains the previous entry with the same hash,
effectively making it a "chain" of length 2.
@@ -607,7 +630,7 @@
fastBase.tmp[8]bytelongTable[524288]prevEntrytable[8192]tableEntry
-
+ AppendCRC will append the CRC to the destination slice and return it.
@@ -628,6 +651,7 @@
ResetDict will reset and set a dictionary if not nil
+ (*betterFastEncoder) ResetPrefix(prefix []byte) useBlock will replace the block with the provided one,
but transfer recent offsets from the previous.
@@ -636,20 +660,25 @@
WindowSize returns the window size of the encoder,
or a window size small enough to contain the input size, if > 0.
-
+ (*betterFastEncoder) addBlock(src []byte) int32 ensureHist will ensure that history can keep at least this many bytes.(*betterFastEncoder) matchlen(s, t int32, src []byte) int32
-
+ Reset the encoding table.
+
+
+ resetBasePrefix resets the encoder state and loads prefix as initial history.
+ This is used for parallel job encoding where non-first jobs need overlap context.
+ Rep offsets are set to defaults [1,4,8] (invalidated, matching C behavior).
*betterFastEncoder : encoder
-
+
@@ -675,7 +704,7 @@
dictTable[]tableEntrylongTableShardDirty[4096]boolshortTableShardDirty[64]bool
-
+ AppendCRC will append the CRC to the destination slice and return it.
@@ -693,9 +722,10 @@
Most notable difference is that src will not be copied for history and
we do not need to check for max match length.
-
+ ResetDict will reset and set a dictionary if not nil
+ (*betterFastEncoderDict) ResetPrefix([]byte) useBlock will replace the block with the provided one,
but transfer recent offsets from the previous.
@@ -704,22 +734,27 @@
WindowSize returns the window size of the encoder,
or a window size small enough to contain the input size, if > 0.
-
+ (*betterFastEncoderDict) addBlock(src []byte) int32 ensureHist will ensure that history can keep at least this many bytes.
- (*betterFastEncoderDict) markLongShardDirty(entryNum uint32)
- (*betterFastEncoderDict) markShortShardDirty(entryNum uint32)
+ (*betterFastEncoderDict) markLongShardDirty(entryNum uint32)
+ (*betterFastEncoderDict) markShortShardDirty(entryNum uint32)(*betterFastEncoderDict) matchlen(s, t int32, src []byte) int32
-
+ Reset the encoding table.
+
+
+ resetBasePrefix resets the encoder state and loads prefix as initial history.
+ This is used for parallel job encoding where non-first jobs need overlap context.
+ Rep offsets are set to defaults [1,4,8] (invalidated, matching C behavior).
*betterFastEncoderDict : encoder
-
@@ -1345,7 +1384,7 @@
fastEncoder.fastBase.tmp[8]bytefastEncoder.table[32768]tableEntrylongTable[131072]tableEntry
-
+ AppendCRC will append the CRC to the destination slice and return it.
@@ -1366,6 +1405,7 @@
ResetDict will reset and set a dictionary if not nil
+ (*doubleFastEncoder) ResetPrefix(prefix []byte) useBlock will replace the block with the provided one,
but transfer recent offsets from the previous.
@@ -1374,20 +1414,25 @@
WindowSize returns the window size of the encoder,
or a window size small enough to contain the input size, if > 0.
-
+ (*doubleFastEncoder) addBlock(src []byte) int32 ensureHist will ensure that history can keep at least this many bytes.(*doubleFastEncoder) matchlen(s, t int32, src []byte) int32
-
+ Reset the encoding table.
+
+
+ resetBasePrefix resets the encoder state and loads prefix as initial history.
+ This is used for parallel job encoding where non-first jobs need overlap context.
+ Rep offsets are set to defaults [1,4,8] (invalidated, matching C behavior).
*doubleFastEncoder : encoder
-
+
@@ -1414,7 +1459,7 @@
fastEncoderDict.tableShardDirty[256]boollongTable[131072]tableEntrylongTableShardDirty[1024]bool
-
+ AppendCRC will append the CRC to the destination slice and return it.
@@ -1432,9 +1477,10 @@
Most notable difference is that src will not be copied for history and
we do not need to check for max match length.
-
+ ResetDict will reset and set a dictionary if not nil
+ (*doubleFastEncoderDict) ResetPrefix([]byte) useBlock will replace the block with the provided one,
but transfer recent offsets from the previous.
@@ -1443,31 +1489,63 @@
WindowSize returns the window size of the encoder,
or a window size small enough to contain the input size, if > 0.
-
+ (*doubleFastEncoderDict) addBlock(src []byte) int32 ensureHist will ensure that history can keep at least this many bytes.
- (*doubleFastEncoderDict) markAllShardsDirty()
- (*doubleFastEncoderDict) markLongShardDirty(entryNum uint32)
- (*doubleFastEncoderDict) markShardDirty(entryNum uint32)
+ (*doubleFastEncoderDict) markAllShardsDirty()
+ (*doubleFastEncoderDict) markLongShardDirty(entryNum uint32)
+ (*doubleFastEncoderDict) markShardDirty(entryNum uint32)(*doubleFastEncoderDict) matchlen(s, t int32, src []byte) int32
-
+ Reset the encoding table.
+
+
+ resetBasePrefix resets the encoder state and loads prefix as initial history.
+ This is used for parallel job encoding where non-first jobs need overlap context.
+ Rep offsets are set to defaults [1,4,8] (invalidated, matching C behavior).
*doubleFastEncoderDict : encoder
-
+
+
+
+
+
+ // closed when complete
+
+
+ // encoding error
+
+
+ // job's own input data (swapped from filling)
+
+
+ // last block of last job gets last=true
+
+
+ // compressed blocks (filled by worker)
+
+
+ // overlap from previous job (nil for first)
+
+
+
+ func (*Encoder).compressJob(enc encoder, job *encJob)
+
+
@@ -1570,7 +1660,7 @@
maximum offset. Should be at least 2x block size.tmp[8]byte
-
+ AppendCRC will append the CRC to the destination slice and return it.
@@ -1588,17 +1678,22 @@
WindowSize returns the window size of the encoder,
or a window size small enough to contain the input size, if > 0.
-
+ (*fastBase) addBlock(src []byte) int32 ensureHist will ensure that history can keep at least this many bytes.(*fastBase) matchlen(s, t int32, src []byte) int32
-
+ Reset the encoding table.
+
+
+ resetBasePrefix resets the encoder state and loads prefix as initial history.
+ This is used for parallel job encoding where non-first jobs need overlap context.
+ Rep offsets are set to defaults [1,4,8] (invalidated, matching C behavior).
-
+
@@ -1617,7 +1712,7 @@
fastBase.tmp[8]bytetable[32768]tableEntry
-
+ AppendCRC will append the CRC to the destination slice and return it.
@@ -1638,6 +1733,7 @@
ResetDict will reset and set a dictionary if not nil
+ (*fastEncoder) ResetPrefix(prefix []byte) useBlock will replace the block with the provided one,
but transfer recent offsets from the previous.
@@ -1646,20 +1742,25 @@
WindowSize returns the window size of the encoder,
or a window size small enough to contain the input size, if > 0.
-
+ (*fastEncoder) addBlock(src []byte) int32 ensureHist will ensure that history can keep at least this many bytes.(*fastEncoder) matchlen(s, t int32, src []byte) int32
-
+ Reset the encoding table.
+
+
+ resetBasePrefix resets the encoder state and loads prefix as initial history.
+ This is used for parallel job encoding where non-first jobs need overlap context.
+ Rep offsets are set to defaults [1,4,8] (invalidated, matching C behavior).
*fastEncoder : encoder
-
+
@@ -1682,7 +1783,7 @@
fastEncoder.fastBase.tmp[8]bytefastEncoder.table[32768]tableEntrytableShardDirty[256]bool
-
+ AppendCRC will append the CRC to the destination slice and return it.
@@ -1700,9 +1801,10 @@
Most notable difference is that src will not be copied for history and
we do not need to check for max match length.
-
+ ResetDict will reset and set a dictionary if not nil
+ (*fastEncoderDict) ResetPrefix([]byte) useBlock will replace the block with the provided one,
but transfer recent offsets from the previous.
@@ -1711,16 +1813,21 @@
WindowSize returns the window size of the encoder,
or a window size small enough to contain the input size, if > 0.
-
+ (*fastEncoderDict) addBlock(src []byte) int32 ensureHist will ensure that history can keep at least this many bytes.
- (*fastEncoderDict) markAllShardsDirty()
- (*fastEncoderDict) markShardDirty(entryNum uint32)
+ (*fastEncoderDict) markAllShardsDirty()
+ (*fastEncoderDict) markShardDirty(entryNum uint32)(*fastEncoderDict) matchlen(s, t int32, src []byte) int32
-
+ Reset the encoding table.
+
+
+ resetBasePrefix resets the encoder state and loads prefix as initial history.
+ This is used for parallel job encoding where non-first jobs need overlap context.
+ Rep offsets are set to defaults [1,4,8] (invalidated, matching C behavior).
@@ -1808,7 +1915,7 @@
-
+ buildDtable will build the decoding table.(*fseDecoder) mustReadFrom(r io.Reader)
@@ -1987,6 +2094,54 @@
(*history) setDict(dict *dict)
+
DecodeTo appends the decoded data from src to dst.
The maximum decoded size is 1GiB,
not including what may already be in dst.
-
+
EncoderLevelFromString will convert a string representation of an encoding level back
to a compression level. The compare is not case sensitive.
If the string wasn't recognized, (false, SpeedDefault) will be returned.
-
+
EncoderLevelFromZstd will return an encoder level that closest matches the compression
ratio of a specific zstd compression level.
Many input values will provide the same compression level.
@@ -2330,17 +2487,27 @@
The Reset function can be used to initiate a new stream, which will considerably
reduce the allocations normally caused by NewReader.
-
+
NewWriter will create a new Zstandard encoder.
If the encoder will be used for encoding blocks a nil writer can be used.
-
+
WithAllLitEntropyCompression will apply entropy compression if no matches are found.
Disabling this will skip incompressible data faster, but in cases with no matches but
skewed character distribution compression is lost.
Default value depends on the compression level selected.
Can be changed with ResetWithOptions.
+
+ WithConcurrentBlocks enables job-based parallel compression for streams.
+ When enabled and concurrent > 1, input is split into large sections (jobs)
+ that are compressed simultaneously by multiple goroutines.
+ Each non-first job receives an overlap prefix from the previous job for match context.
+ Output is flushed in order, producing a valid single-frame zstd stream.
+
+ Currently disabled when used with dictionary encoding.
+ Cannot be changed with ResetWithOptions.
+
WithDecodeAllCapLimit will limit DecodeAll to decoding cap(dst)-len(dst) bytes,
or any size set in WithDecoderMaxMemory.
@@ -2410,7 +2577,7 @@
Default is 512MB, Maximum is ~3.75 TB as per zstandard spec.
Can be changed with ResetWithOptions.
-
+
WithEncoderConcurrency will set the concurrency,
meaning the maximum number of encoders to run concurrently.
The value supplied must be at least 0.
@@ -2419,12 +2586,12 @@
By default this will be set to GOMAXPROCS.
Cannot be changed with ResetWithOptions.
-
+
WithEncoderCRC will add CRC value to output.
Output will be 4 bytes larger.
Can be changed with ResetWithOptions.
-
+
WithEncoderDict allows to register a dictionary that will be used for the encode.
The slice dict must be in the [dictionary format] produced by
@@ -2435,22 +2602,22 @@
[dictionary format]: https://github.com/facebook/zstd/blob/dev/doc/zstd_compression_format.md#dictionary-format
-
+
WithEncoderDictDelete clears the dictionary, so no dictionary will be used.
Should be used with ResetWithOptions.
-
+
WithEncoderDictRaw registers a dictionary that may be used by the encoder.
The slice content may contain arbitrary data. It will be used as an initial
history.
Can be changed with ResetWithOptions.
-
+
WithEncoderLevel specifies a predefined compression level.
Cannot be changed with ResetWithOptions.
-
+
WithEncoderPadding will add padding to all output so the size will be a multiple of n.
This can be used to obfuscate the exact output size or make blocks of a certain size.
The contents will be a skippable frame, so it will be invisible by the decoder.
@@ -2459,20 +2626,20 @@
If `EncodeAll` is used with data already in the destination, the total size will be multiple of this.
Can be changed with ResetWithOptions.
-
+
WithLowerEncoderMem will trade in some memory cases trade less memory usage for
slower encoding speed.
This will not change the window size which is the primary function for reducing
memory usage. See WithWindowSize.
Cannot be changed with ResetWithOptions.
-
+
WithNoEntropyCompression will always skip entropy compression of literals.
This can be useful if content has matches, but unlikely to benefit from entropy
compression. Usually the slight speed improvement is not worth enabling this.
Can be changed with ResetWithOptions.
-
+
WithSingleSegment will set the "single segment" flag when EncodeAll is used.
If this flag is set, data must be regenerated within a single continuous memory segment.
In this case, Window_Descriptor byte is skipped, but Frame_Content_Size is necessarily present.
@@ -2485,7 +2652,7 @@
This setting has no effect on streamed encodes.
Can be changed with ResetWithOptions.
-
+
WithWindowSize will set the maximum allowed back-reference distance.
The value must be a power of two between MinWindowSize and MaxWindowSize.
A larger value will enable better compression but allocate more memory and,
@@ -2493,7 +2660,7 @@
The default value is determined by the compression level and max 8MB.
Cannot be changed with ResetWithOptions.
-
+
WithZeroFrames will encode 0 length input as full frames.
This can be needed for compatibility with zstandard usage,
but is not needed for this package.
@@ -2510,8 +2677,8 @@
and by default a 128MB maximum decompression window is specified.
The window size can be overridden if required.
-
- buildDtable_asm is an x86 assembly implementation of fseDecoder.buildDtable.
+
+ buildDtable_asm is an assembly implementation of fseDecoder.buildDtable.
Function returns non-zero exit code on error.
@@ -2520,13 +2687,22 @@
The value will always be > skippableFrameHeader.
The function will panic if written < 0 or wantMultiple <= 0.
+
+ decodeAsm runs the sequenceDecs decode loop, choosing the BMI2 / 56-bit variant.
+
decodeSnappy writes the decoding of src to dst. It assumes that the varint-encoded
length of the decompressed bytes has already been read.
+
+ decodeSyncAsm runs the decodeSync loop, choosing the BMI2 / safe variant.
+
decSymbolValue returns the transformed decSymbol for the given symbol.
+
+ executeSimpleAsm runs the executeSimple loop, choosing the safe variant.
+
fillBase will precalculate base offsets with the given bit distributions.
@@ -2560,44 +2736,42 @@
+ sequenceDecs_decode_56_amd64 implements the main loop of sequenceDecs in x86 asm.
-
- sequenceDecs_decode implements the main loop of sequenceDecs in x86 asm with BMI2 extensions.
+
+ sequenceDecs_decode_56_bmi2 implements the main loop of sequenceDecs in x86 asm with BMI2 extensions.
-
+
sequenceDecs_decode implements the main loop of sequenceDecs in x86 asm.
Please refer to seqdec_generic.go for the reference implementation.
-
- sequenceDecs_decode implements the main loop of sequenceDecs in x86 asm with BMI2 extensions.
+
+ sequenceDecs_decode_bmi2 implements the main loop of sequenceDecs in x86 asm with BMI2 extensions.
-
+
sequenceDecs_decodeSync_amd64 implements the main loop of sequenceDecs.decodeSync in x86 asm.
Please refer to seqdec_generic.go for the reference implementation.
-
+
sequenceDecs_decodeSync_bmi2 implements the main loop of sequenceDecs.decodeSync in x86 asm with BMI2 extensions.
-
+
sequenceDecs_decodeSync_safe_amd64 does the same as above, but does not write more than output buffer.
-
+
sequenceDecs_decodeSync_safe_bmi2 does the same as above, but does not write more than output buffer.
-
+
sequenceDecs_executeSimple_amd64 implements the main loop of sequenceDecs.executeSimple in x86 asm.
Returns false if a match offset is too big.
Please refer to seqdec_generic.go for the reference implementation.
-
+
Same as above, but with safe memcopies
@@ -2731,20 +2905,20 @@
MinWindowSize is the minimum Window Size, which is 1 KB.
-
+
SpeedBestCompression will choose the best available compression option.
This will offer the best compression no matter the CPU cost.
-
+
SpeedBetterCompression will yield better compression than the default.
Currently it is about zstd level 7-8 with ~ 2x-3x the default CPU usage.
By using this, notice that CPU usage may go up in the future.
-
+
SpeedDefault is the default "pretty fast" compression option.
This is roughly equivalent to the default Zstandard mode (level 3).
-
+
SpeedFastest will choose the fastest reasonable compression.
This is roughly equivalent to the fastest Zstandard mode.
@@ -2790,31 +2964,31 @@
snappyMaxBlockSize is the maximum size of the input to encodeBlock. It is not
part of the wire format per se, but some parts of the encoder assume
that an offset fits into a uint16.
@@ -2865,11 +3039,11 @@
be a const. Their equivalence is confirmed by
TestMaxEncodedLenOfMaxBlockSize.
-
// Copyright 2016 The Go Authors. All rights reserved.
@@ -126,157 +136,175 @@
hist []byte// Sliding window history// Invariant: 0 <= rdPos <= wrPos <= len(hist)
-wrPosint// Current output position in buffer
-rdPosint// Have emitted hist[:rdPos] already
-fullbool// Has a full window length been written yet?
-}
-
-// init initializes dictDecoder to have a sliding window dictionary of the given
-// size. If a preset dict is provided, it will initialize the dictionary with
-// the contents of dict.
-func ( *dictDecoder) ( int, []byte) {
- * = dictDecoder{hist: .hist}
-
-ifcap(.hist) < {
- .hist = make([]byte, )
- }
- .hist = .hist[:]
-
-iflen() > len(.hist) {
- = [len()-len(.hist):]
- }
- .wrPos = copy(.hist, )
-if .wrPos == len(.hist) {
- .wrPos = 0
- .full = true
- }
- .rdPos = .wrPos
-}
-
-// histSize reports the total amount of historical data in the dictionary.
-func ( *dictDecoder) () int {
-if .full {
-returnlen(.hist)
- }
-return .wrPos
-}
-
-// availRead reports the number of bytes that can be flushed by readFlush.
-func ( *dictDecoder) () int {
-return .wrPos - .rdPos
-}
-
-// availWrite reports the available amount of output buffer space.
-func ( *dictDecoder) () int {
-returnlen(.hist) - .wrPos
-}
-
-// writeSlice returns a slice of the available buffer to write data to.
-//
-// This invariant will be kept: len(s) <= availWrite()
-func ( *dictDecoder) () []byte {
-return .hist[.wrPos:]
-}
-
-// writeMark advances the writer pointer by cnt.
-//
-// This invariant must be kept: 0 <= cnt <= availWrite()
-func ( *dictDecoder) ( int) {
- .wrPos +=
-}
-
-// writeByte writes a single byte to the dictionary.
-//
-// This invariant must be kept: 0 < availWrite()
-func ( *dictDecoder) ( byte) {
- .hist[.wrPos] =
- .wrPos++
-}
-
-// writeCopy copies a string at a given (dist, length) to the output.
-// This returns the number of bytes copied and may be less than the requested
-// length if the available space in the output buffer is too small.
-//
-// This invariant must be kept: 0 < dist <= histSize()
-func ( *dictDecoder) (, int) int {
- := .wrPos
- :=
- := -
- := min(+, len(.hist))
-
-// Copy non-overlapping section after destination position.
- //
- // This section is non-overlapping in that the copy length for this section
- // is always less than or equal to the backwards distance. This can occur
- // if a distance refers to data that wraps-around in the buffer.
- // Thus, a backwards copy is performed here; that is, the exact bytes in
- // the source prior to the copy is placed in the destination.
-if < 0 {
- += len(.hist)
- += copy(.hist[:], .hist[:])
- = 0
- }
-
-// Copy possibly overlapping section before destination position.
- //
- // This section can overlap if the copy length for this section is larger
- // than the backwards distance. This is allowed by LZ77 so that repeated
- // strings can be succinctly represented using (dist, length) pairs.
- // Thus, a forwards copy is performed here; that is, the bytes copied is
- // possibly dependent on the resulting bytes in the destination as the copy
- // progresses along. This is functionally equivalent to the following:
- //
- // for i := 0; i < endPos-dstPos; i++ {
- // dd.hist[dstPos+i] = dd.hist[srcPos+i]
- // }
- // dstPos = endPos
- //
-for < {
- += copy(.hist[:], .hist[:])
- }
-
- .wrPos =
-return -
-}
-
-// tryWriteCopy tries to copy a string at a given (distance, length) to the
-// output. This specialized version is optimized for short distances.
-//
-// This method is designed to be inlined for performance reasons.
-//
-// This invariant must be kept: 0 < dist <= histSize()
-func ( *dictDecoder) (, int) int {
- := .wrPos
- := +
-if < || > len(.hist) {
-return0
- }
- :=
- := -
-
-// Copy possibly overlapping section before destination position.
-:
- += copy(.hist[:], .hist[:])
-if < {
-goto// Avoid for-loop so that this function can be inlined
- }
-
- .wrPos =
-return -
-}
-
-// readFlush returns a slice of the historical buffer that is ready to be
-// emitted to the user. The data returned by readFlush must be fully consumed
-// before calling any other dictDecoder methods.
-func ( *dictDecoder) () []byte {
- := .hist[.rdPos:.wrPos]
- .rdPos = .wrPos
-if .wrPos == len(.hist) {
- .wrPos, .rdPos = 0, 0
- .full = true
- }
-return
-}
+wrPosint// Current output position in buffer
+rdPosint// Have emitted hist[:rdPos] already
+flushedint64// Total bytes returned by readFlush since init
+fullbool// Has a full window length been written yet?
+}
+
+// init initializes dictDecoder to have a sliding window dictionary of the given
+// size. If a preset dict is provided, it will initialize the dictionary with
+// the contents of dict.
+func ( *dictDecoder) ( int, []byte) {
+ * = dictDecoder{hist: .hist}
+
+ifcap(.hist) < {
+ .hist = make([]byte, )
+ }
+ .hist = .hist[:]
+
+iflen() > len(.hist) {
+ = [len()-len(.hist):]
+ }
+ .wrPos = copy(.hist, )
+if .wrPos == len(.hist) {
+ .wrPos = 0
+ .full = true
+ }
+ .rdPos = .wrPos
+}
+
+// histSize reports the total amount of historical data in the dictionary.
+func ( *dictDecoder) () int {
+if .full {
+returnlen(.hist)
+ }
+return .wrPos
+}
+
+// availRead reports the number of bytes that can be flushed by readFlush.
+func ( *dictDecoder) () int {
+return .wrPos - .rdPos
+}
+
+// availWrite reports the available amount of output buffer space.
+func ( *dictDecoder) () int {
+returnlen(.hist) - .wrPos
+}
+
+// writeSlice returns a slice of the available buffer to write data to.
+//
+// This invariant will be kept: len(s) <= availWrite()
+func ( *dictDecoder) () []byte {
+return .hist[.wrPos:]
+}
+
+// writeMark advances the writer pointer by cnt.
+//
+// This invariant must be kept: 0 <= cnt <= availWrite()
+func ( *dictDecoder) ( int) {
+ .wrPos +=
+}
+
+// writeByte writes a single byte to the dictionary.
+//
+// This invariant must be kept: 0 < availWrite()
+func ( *dictDecoder) ( byte) {
+ .hist[.wrPos] =
+ .wrPos++
+}
+
+// writeCopy copies a string at a given (dist, length) to the output.
+// This returns the number of bytes copied and may be less than the requested
+// length if the available space in the output buffer is too small.
+//
+// This invariant must be kept: 0 < dist <= histSize()
+func ( *dictDecoder) (, int) int {
+ := .wrPos
+ :=
+ := -
+ := min(+, len(.hist))
+
+// Copy non-overlapping section after destination position.
+ //
+ // This section is non-overlapping in that the copy length for this section
+ // is always less than or equal to the backwards distance. This can occur
+ // if a distance refers to data that wraps-around in the buffer.
+ // Thus, a backwards copy is performed here; that is, the exact bytes in
+ // the source prior to the copy is placed in the destination.
+if < 0 {
+ += len(.hist)
+ += copy(.hist[:], .hist[:])
+ = 0
+ }
+
+// Copy possibly overlapping section before destination position.
+ //
+ // This section can overlap if the copy length for this section is larger
+ // than the backwards distance. This is allowed by LZ77 so that repeated
+ // strings can be succinctly represented using (dist, length) pairs.
+ // Thus, a forwards copy is performed here; that is, the bytes copied is
+ // possibly dependent on the resulting bytes in the destination as the copy
+ // progresses along. This is functionally equivalent to the following:
+ //
+ // for i := 0; i < endPos-dstPos; i++ {
+ // dd.hist[dstPos+i] = dd.hist[srcPos+i]
+ // }
+ // dstPos = endPos
+ //
+for < {
+ += copy(.hist[:], .hist[:])
+ }
+
+ .wrPos =
+return -
+}
+
+// tryWriteCopy tries to copy a string at a given (distance, length) to the
+// output. This specialized version is optimized for short distances.
+//
+// This method is designed to be inlined for performance reasons.
+//
+// This invariant must be kept: 0 < dist <= histSize()
+func ( *dictDecoder) (, int) int {
+ := .wrPos
+ := +
+if < || > len(.hist) {
+return0
+ }
+ :=
+ := -
+
+// Copy possibly overlapping section before destination position.
+:
+ += copy(.hist[:], .hist[:])
+if < {
+goto// Avoid for-loop so that this function can be inlined
+ }
+
+ .wrPos =
+return -
+}
+
+// appendWindow appends the current sliding window (up to len(hist) most recent
+// bytes, oldest first) to dst.
+func ( *dictDecoder) ( []byte) []byte {
+if .full {
+ = append(, .hist[.wrPos:]...)
+returnappend(, .hist[:.wrPos]...)
+ }
+returnappend(, .hist[:.wrPos]...)
+}
+
+// readFlush returns a slice of the historical buffer that is ready to be
+// emitted to the user. The data returned by readFlush must be fully consumed
+// before calling any other dictDecoder methods.
+func ( *dictDecoder) () []byte {
+ := .hist[.rdPos:.wrPos]
+ .flushed += int64(len())
+ .rdPos = .wrPos
+if .wrPos == len(.hist) {
+ .wrPos, .rdPos = 0, 0
+ .full = true
+ }
+return
+}
+
+// decoded reports the total number of bytes written into the dictionary since
+// init (i.e. excluding any preset dict bytes).
+func ( *dictDecoder) () int64 {
+return .flushed + int64(.wrPos-.rdPos)
+}
+package huff0
+
+import
+
+// BuildCTable builds a Huffman compression table from a precomputed symbol
+// histogram and installs it as the previous (reuse) table on s.
+//
+// After this call:
+// - EstimateSize/CanUseTable can probe the table against other histograms.
+// - Compress1X/Compress4X with Reuse = ReusePolicyMust will encode without
+// emitting a new table header.
+// - TransferCTable can hand the table to a sibling Scratch.
+//
+// count[i] is the number of occurrences of symbol i. The histogram must have
+// at least 2 distinct non-zero symbols; ErrUseRLE is returned for a single
+// symbol and an error is returned for an empty histogram.
+func ( *Scratch) ( *[256]uint32) error {
+if == nil {
+returnerrors.New("huff0: BuildCTable on nil Scratch")
+ }
+if == nil {
+returnerrors.New("huff0: nil count passed to BuildCTable")
+ }
+varerror
+ , = .prepare(nil)
+if != nil {
+return
+ }
+ .count = *
+var , int
+varuint16
+for , := range .count {
+ += int()
+ifint() > {
+ = int()
+ }
+if != 0 {
+ = uint16() + 1
+ }
+ }
+if == 0 {
+returnerrors.New("huff0: empty histogram")
+ }
+if < 2 || == {
+returnErrUseRLE
+ }
+// huff0's internal rank table assumes total ≤ BlockSizeMax (it uses
+ // highBit32(count+1) + 1 as a rank index into a fixed-size array).
+ // Histograms summed across multiple blocks can exceed that; scale the
+ // counts down preserving the distribution. Non-zero entries round up so
+ // rare symbols stay representable.
+if > BlockSizeMax {
+ := uint(0)
+for >> > BlockSizeMax {
+ ++
+ }
+ := uint32(1<<) - 1
+var , int
+for , := range .count {
+if == 0 {
+continue
+ }
+ := ( + ) >>
+if == 0 {
+ = 1
+ }
+ .count[] =
+ += int()
+ifint() > {
+ = int()
+ }
+ }
+ =
+ =
+if == {
+returnErrUseRLE
+ }
+ }
+ .symbolLen =
+ .maxCount =
+ .srcLen =
+if := .buildCTable(); != nil {
+return
+ }
+ifcap(.prevTable) < len(.cTable) {
+ .prevTable = make(cTable, 0, maxSymbolValue+1)
+ }
+ .prevTable = .prevTable[:len(.cTable)]
+copy(.prevTable, .cTable)
+ .prevTableLog = .actualTableLog
+// Force the next Compress* to recount from real input.
+ .clearCount = true
+ .maxCount = 0
+returnnil
+}
+
+// EstimateSize returns an estimated compressed payload size in bytes for the
+// supplied histogram using the table currently stored in prevTable. It returns
+// -1 when the table cannot encode every non-zero symbol of hist (i.e. when
+// CanUseTable would return false). The estimate excludes the table header.
+func ( *Scratch) ( *[256]uint32) int {
+if == nil || == nil || len(.prevTable) == 0 {
+return -1
+ }
+ := .prevTable
+ := uint32(7)
+for , := range {
+if == 0 {
+continue
+ }
+if >= len() || [].nBits == 0 {
+return -1
+ }
+ += uint32([].nBits) *
+ }
+returnint( >> 3)
+}
+
+// CanUseTable reports whether the table in prevTable can encode every
+// non-zero symbol present in hist.
+func ( *Scratch) ( *[256]uint32) bool {
+if == nil || == nil || len(.prevTable) == 0 {
+returnfalse
+ }
+ := .prevTable
+for , := range {
+if == 0 {
+continue
+ }
+if >= len() || [].nBits == 0 {
+returnfalse
+ }
+ }
+returntrue
+}
+
+// AppendTable serializes the table currently stored in prevTable (e.g. as
+// installed by BuildCTable or carried over from a previous Compress call)
+// into a self-delimiting zstd-style header and appends it to dst. The
+// returned slice can be parsed back by ReadTable.
+func ( *Scratch) ( []byte) ([]byte, error) {
+if == nil || len(.prevTable) == 0 {
+return , errors.New("huff0: AppendTable with empty table")
+ }
+// cTable.write reads s.actualTableLog, s.symbolLen, s.huffWeight, s.fse
+ // and writes into s.Out. Save/restore Out so we don't disturb in-flight
+ // compression buffers.
+ := .Out
+ := .actualTableLog
+ := .symbolLen
+if .fse == nil {
+// Lazily init in case AppendTable is called on a fresh Scratch.
+if , := .prepare(nil); != nil {
+return ,
+ }
+ = .Out
+ }
+ .Out = .Out[:0]
+ .actualTableLog = .prevTableLog
+ .symbolLen = uint16(len(.prevTable))
+if := .prevTable.write(); != nil {
+ .Out, .actualTableLog, .symbolLen = , ,
+return ,
+ }
+ = append(, .Out...)
+ .Out, .actualTableLog, .symbolLen = , ,
+return , nil
+}
+
+
+
The pages are generated with Goldsv0.8.4. (GOOS=linux GOARCH=amd64)
+Golds is a Go 101 project developed by Tapir Liu.
+PR and bug reports are welcome and can be submitted to the issue list.
+Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds.
The pages are generated with Goldsv0.8.4. (GOOS=linux GOARCH=amd64)
+Golds is a Go 101 project developed by Tapir Liu.
+PR and bug reports are welcome and can be submitted to the issue list.
+Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds.
The pages are generated with Goldsv0.8.4. (GOOS=linux GOARCH=amd64)
diff --git a/src/github.com/klauspost/compress/zstd/encoder_options.go.html b/src/github.com/klauspost/compress/zstd/encoder_options.go.html
index 14835229e42..0de7afcf19e 100644
--- a/src/github.com/klauspost/compress/zstd/encoder_options.go.html
+++ b/src/github.com/klauspost/compress/zstd/encoder_options.go.html
@@ -67,7 +67,15 @@
input[id=r48]:checked ~pre label[for=r48],
input[id=r49]:checked ~pre label[for=r49],
input[id=r50]:checked ~pre label[for=r50],
-input[id=r51]:checked ~pre label[for=r51]
+input[id=r51]:checked ~pre label[for=r51],
+input[id=r52]:checked ~pre label[for=r52],
+input[id=r53]:checked ~pre label[for=r53],
+input[id=r54]:checked ~pre label[for=r54],
+input[id=r55]:checked ~pre label[for=r55],
+input[id=r56]:checked ~pre label[for=r56],
+input[id=r57]:checked ~pre label[for=r57],
+input[id=r58]:checked ~pre label[for=r58],
+input[id=r59]:checked ~pre label[for=r59]
{background: #226; color: #ff8;}
input[id=i0]:checked ~pre .i0,
input[id=i1]:checked ~pre .i1,
@@ -128,6 +136,14 @@
+
+
+
+
+
+
+
+
@@ -152,368 +168,405 @@
// options retains accumulated state of multiple options.typeencoderOptionsstruct {
-resetOptbool
-concurrentint
-levelEncoderLevel
-single *bool
-padint
-blockSizeint
-windowSizeint
-crcbool
-fullZerobool
-noEntropybool
-allLitEntropybool
-customWindowbool
-customALEntropybool
-customBlockSizebool
-lowMembool
-dict *dict
-}
-
-func ( *encoderOptions) () {
- * = encoderOptions{
-concurrent: runtime.GOMAXPROCS(0),
-crc: true,
-single: nil,
-blockSize: maxCompressedBlockSize,
-windowSize: 8 << 20,
-level: SpeedDefault,
-allLitEntropy: false,
-lowMem: false,
-fullZero: true,
- }
-}
-
-// encoder returns an encoder with the selected options.
-func ( encoderOptions) () encoder {
-switch .level {
-caseSpeedFastest:
-if .dict != nil {
-return &fastEncoderDict{fastEncoder: fastEncoder{fastBase: fastBase{maxMatchOff: int32(.windowSize), bufferReset: math.MaxInt32 - int32(.windowSize*2), lowMem: .lowMem}}}
- }
-return &fastEncoder{fastBase: fastBase{maxMatchOff: int32(.windowSize), bufferReset: math.MaxInt32 - int32(.windowSize*2), lowMem: .lowMem}}
-
-caseSpeedDefault:
-if .dict != nil {
-return &doubleFastEncoderDict{fastEncoderDict: fastEncoderDict{fastEncoder: fastEncoder{fastBase: fastBase{maxMatchOff: int32(.windowSize), bufferReset: math.MaxInt32 - int32(.windowSize*2), lowMem: .lowMem}}}}
- }
-return &doubleFastEncoder{fastEncoder: fastEncoder{fastBase: fastBase{maxMatchOff: int32(.windowSize), bufferReset: math.MaxInt32 - int32(.windowSize*2), lowMem: .lowMem}}}
-caseSpeedBetterCompression:
-if .dict != nil {
-return &betterFastEncoderDict{betterFastEncoder: betterFastEncoder{fastBase: fastBase{maxMatchOff: int32(.windowSize), bufferReset: math.MaxInt32 - int32(.windowSize*2), lowMem: .lowMem}}}
- }
-return &betterFastEncoder{fastBase: fastBase{maxMatchOff: int32(.windowSize), bufferReset: math.MaxInt32 - int32(.windowSize*2), lowMem: .lowMem}}
-caseSpeedBestCompression:
-return &bestFastEncoder{fastBase: fastBase{maxMatchOff: int32(.windowSize), bufferReset: math.MaxInt32 - int32(.windowSize*2), lowMem: .lowMem}}
- }
-panic("unknown compression level")
-}
-
-// WithEncoderCRC will add CRC value to output.
-// Output will be 4 bytes larger.
-// Can be changed with ResetWithOptions.
-func ( bool) EOption {
-returnfunc( *encoderOptions) error { .crc = ; returnnil }
-}
-
-// WithEncoderConcurrency will set the concurrency,
-// meaning the maximum number of encoders to run concurrently.
-// The value supplied must be at least 0.
-// When a value of 0 is provided GOMAXPROCS will be used.
-// For streams, setting a value of 1 will disable async compression.
-// By default this will be set to GOMAXPROCS.
-// Cannot be changed with ResetWithOptions.
-func ( int) EOption {
-returnfunc( *encoderOptions) error {
-if < 0 {
-returnerrors.New("concurrency must at least 0")
- }
-if == 0 {
- = runtime.GOMAXPROCS(0)
- }
-if .resetOpt && != .concurrent {
-returnerrors.New("WithEncoderConcurrency cannot be changed on Reset")
- }
- .concurrent =
-returnnil
- }
-}
-
-// WithWindowSize will set the maximum allowed back-reference distance.
-// The value must be a power of two between MinWindowSize and MaxWindowSize.
-// A larger value will enable better compression but allocate more memory and,
-// for above-default values, take considerably longer.
-// The default value is determined by the compression level and max 8MB.
-// Cannot be changed with ResetWithOptions.
-func ( int) EOption {
-returnfunc( *encoderOptions) error {
-switch {
-case < MinWindowSize:
-returnfmt.Errorf("window size must be at least %d", MinWindowSize)
-case > MaxWindowSize:
-returnfmt.Errorf("window size must be at most %d", MaxWindowSize)
-case ( & ( - 1)) != 0:
-returnerrors.New("window size must be a power of 2")
- }
-if .resetOpt && != .windowSize {
-returnerrors.New("WithWindowSize cannot be changed on Reset")
- }
-
- .windowSize =
- .customWindow = true
-if .blockSize > .windowSize {
- .blockSize = .windowSize
- .customBlockSize = true
- }
-returnnil
- }
-}
-
-// WithEncoderPadding will add padding to all output so the size will be a multiple of n.
-// This can be used to obfuscate the exact output size or make blocks of a certain size.
-// The contents will be a skippable frame, so it will be invisible by the decoder.
-// n must be > 0 and <= 1GB, 1<<30 bytes.
-// The padded area will be filled with data from crypto/rand.Reader.
-// If `EncodeAll` is used with data already in the destination, the total size will be multiple of this.
-// Can be changed with ResetWithOptions.
-func ( int) EOption {
-returnfunc( *encoderOptions) error {
-if <= 0 {
-returnfmt.Errorf("padding must be at least 1")
- }
-// No need to waste our time.
-if == 1 {
- = 0
- }
-if > 1<<30 {
-returnfmt.Errorf("padding must less than 1GB (1<<30 bytes) ")
- }
- .pad =
-returnnil
- }
-}
-
-// EncoderLevel predefines encoder compression levels.
-// Only use the constants made available, since the actual mapping
-// of these values are very likely to change and your compression could change
-// unpredictably when upgrading the library.
-typeEncoderLevelint
-
-const (
-speedNotSetEncoderLevel = iota
-
-// SpeedFastest will choose the fastest reasonable compression.
- // This is roughly equivalent to the fastest Zstandard mode.
-SpeedFastest
-
-// SpeedDefault is the default "pretty fast" compression option.
- // This is roughly equivalent to the default Zstandard mode (level 3).
-SpeedDefault
-
-// SpeedBetterCompression will yield better compression than the default.
- // Currently it is about zstd level 7-8 with ~ 2x-3x the default CPU usage.
- // By using this, notice that CPU usage may go up in the future.
-SpeedBetterCompression
-
-// SpeedBestCompression will choose the best available compression option.
- // This will offer the best compression no matter the CPU cost.
-SpeedBestCompression
-
-// speedLast should be kept as the last actual compression option.
- // The is not for external usage, but is used to keep track of the valid options.
-speedLast
-)
-
-// EncoderLevelFromString will convert a string representation of an encoding level back
-// to a compression level. The compare is not case sensitive.
-// If the string wasn't recognized, (false, SpeedDefault) will be returned.
-func ( string) (bool, EncoderLevel) {
-for := speedNotSet + 1; < speedLast; ++ {
-ifstrings.EqualFold(, .String()) {
-returntrue,
- }
- }
-returnfalse, SpeedDefault
-}
-
-// EncoderLevelFromZstd will return an encoder level that closest matches the compression
-// ratio of a specific zstd compression level.
-// Many input values will provide the same compression level.
-func ( int) EncoderLevel {
-switch {
-case < 3:
-returnSpeedFastest
-case >= 3 && < 6:
-returnSpeedDefault
-case >= 6 && < 10:
-returnSpeedBetterCompression
-default:
-returnSpeedBestCompression
- }
-}
-
-// String provides a string representation of the compression level.
-func ( EncoderLevel) () string {
-switch {
-caseSpeedFastest:
-return"fastest"
-caseSpeedDefault:
-return"default"
-caseSpeedBetterCompression:
-return"better"
-caseSpeedBestCompression:
-return"best"
-default:
-return"invalid"
- }
-}
-
-// WithEncoderLevel specifies a predefined compression level.
-// Cannot be changed with ResetWithOptions.
-func ( EncoderLevel) EOption {
-returnfunc( *encoderOptions) error {
-switch {
-case <= speedNotSet || >= speedLast:
-returnfmt.Errorf("unknown encoder level")
- }
-if .resetOpt && != .level {
-returnerrors.New("WithEncoderLevel cannot be changed on Reset")
- }
- .level =
-if !.customWindow {
-switch .level {
-caseSpeedFastest:
- .windowSize = 4 << 20
-if !.customBlockSize {
- .blockSize = 1 << 16
- }
-caseSpeedDefault:
- .windowSize = 8 << 20
-caseSpeedBetterCompression:
- .windowSize = 8 << 20
-caseSpeedBestCompression:
- .windowSize = 8 << 20
- }
- }
-if !.customALEntropy {
- .allLitEntropy = > SpeedDefault
- }
-
-returnnil
- }
-}
-
-// WithZeroFrames will encode 0 length input as full frames.
-// This can be needed for compatibility with zstandard usage,
-// but is not needed for this package.
-// Can be changed with ResetWithOptions.
-func ( bool) EOption {
-returnfunc( *encoderOptions) error {
- .fullZero =
-returnnil
- }
-}
-
-// WithAllLitEntropyCompression will apply entropy compression if no matches are found.
-// Disabling this will skip incompressible data faster, but in cases with no matches but
-// skewed character distribution compression is lost.
-// Default value depends on the compression level selected.
-// Can be changed with ResetWithOptions.
-func ( bool) EOption {
-returnfunc( *encoderOptions) error {
- .customALEntropy = true
- .allLitEntropy =
-returnnil
- }
-}
-
-// WithNoEntropyCompression will always skip entropy compression of literals.
-// This can be useful if content has matches, but unlikely to benefit from entropy
-// compression. Usually the slight speed improvement is not worth enabling this.
-// Can be changed with ResetWithOptions.
-func ( bool) EOption {
-returnfunc( *encoderOptions) error {
- .noEntropy =
-returnnil
- }
-}
-
-// WithSingleSegment will set the "single segment" flag when EncodeAll is used.
-// If this flag is set, data must be regenerated within a single continuous memory segment.
-// In this case, Window_Descriptor byte is skipped, but Frame_Content_Size is necessarily present.
-// As a consequence, the decoder must allocate a memory segment of size equal or larger than size of your content.
-// In order to preserve the decoder from unreasonable memory requirements,
-// a decoder is allowed to reject a compressed frame which requests a memory size beyond decoder's authorized range.
-// For broader compatibility, decoders are recommended to support memory sizes of at least 8 MB.
-// This is only a recommendation, each decoder is free to support higher or lower limits, depending on local limitations.
-// If this is not specified, block encodes will automatically choose this based on the input size and the window size.
-// This setting has no effect on streamed encodes.
-// Can be changed with ResetWithOptions.
-func ( bool) EOption {
-returnfunc( *encoderOptions) error {
- .single = &
-returnnil
- }
-}
-
-// WithLowerEncoderMem will trade in some memory cases trade less memory usage for
-// slower encoding speed.
-// This will not change the window size which is the primary function for reducing
-// memory usage. See WithWindowSize.
-// Cannot be changed with ResetWithOptions.
-func ( bool) EOption {
-returnfunc( *encoderOptions) error {
-if .resetOpt && != .lowMem {
-returnerrors.New("WithLowerEncoderMem cannot be changed on Reset")
- }
- .lowMem =
-returnnil
- }
-}
-
-// WithEncoderDict allows to register a dictionary that will be used for the encode.
-//
-// The slice dict must be in the [dictionary format] produced by
-// "zstd --train" from the Zstandard reference implementation.
-//
-// The encoder *may* choose to use no dictionary instead for certain payloads.
-// Can be changed with ResetWithOptions.
-//
-// [dictionary format]: https://github.com/facebook/zstd/blob/dev/doc/zstd_compression_format.md#dictionary-format
-func ( []byte) EOption {
+resetOptbool
+concurrentint
+levelEncoderLevel
+single *bool
+padint
+blockSizeint
+windowSizeint
+crcbool
+fullZerobool
+noEntropybool
+allLitEntropybool
+customWindowbool
+customALEntropybool
+customBlockSizebool
+lowMembool
+dict *dict
+concurrentBlocksbool
+}
+
+func ( *encoderOptions) () {
+ * = encoderOptions{
+concurrent: runtime.GOMAXPROCS(0),
+crc: true,
+single: nil,
+blockSize: maxCompressedBlockSize,
+windowSize: 8 << 20,
+level: SpeedDefault,
+allLitEntropy: false,
+lowMem: false,
+fullZero: true,
+ }
+}
+
+// encoder returns an encoder with the selected options.
+func ( encoderOptions) () encoder {
+switch .level {
+caseSpeedFastest:
+if .dict != nil {
+return &fastEncoderDict{fastEncoder: fastEncoder{fastBase: fastBase{maxMatchOff: int32(.windowSize), bufferReset: math.MaxInt32 - int32(.windowSize*2), lowMem: .lowMem}}}
+ }
+return &fastEncoder{fastBase: fastBase{maxMatchOff: int32(.windowSize), bufferReset: math.MaxInt32 - int32(.windowSize*2), lowMem: .lowMem}}
+
+caseSpeedDefault:
+if .dict != nil {
+return &doubleFastEncoderDict{fastEncoderDict: fastEncoderDict{fastEncoder: fastEncoder{fastBase: fastBase{maxMatchOff: int32(.windowSize), bufferReset: math.MaxInt32 - int32(.windowSize*2), lowMem: .lowMem}}}}
+ }
+return &doubleFastEncoder{fastEncoder: fastEncoder{fastBase: fastBase{maxMatchOff: int32(.windowSize), bufferReset: math.MaxInt32 - int32(.windowSize*2), lowMem: .lowMem}}}
+caseSpeedBetterCompression:
+if .dict != nil {
+return &betterFastEncoderDict{betterFastEncoder: betterFastEncoder{fastBase: fastBase{maxMatchOff: int32(.windowSize), bufferReset: math.MaxInt32 - int32(.windowSize*2), lowMem: .lowMem}}}
+ }
+return &betterFastEncoder{fastBase: fastBase{maxMatchOff: int32(.windowSize), bufferReset: math.MaxInt32 - int32(.windowSize*2), lowMem: .lowMem}}
+caseSpeedBestCompression:
+return &bestFastEncoder{fastBase: fastBase{maxMatchOff: int32(.windowSize), bufferReset: math.MaxInt32 - int32(.windowSize*2), lowMem: .lowMem}}
+ }
+panic("unknown compression level")
+}
+
+// WithEncoderCRC will add CRC value to output.
+// Output will be 4 bytes larger.
+// Can be changed with ResetWithOptions.
+func ( bool) EOption {
+returnfunc( *encoderOptions) error { .crc = ; returnnil }
+}
+
+// WithEncoderConcurrency will set the concurrency,
+// meaning the maximum number of encoders to run concurrently.
+// The value supplied must be at least 0.
+// When a value of 0 is provided GOMAXPROCS will be used.
+// For streams, setting a value of 1 will disable async compression.
+// By default this will be set to GOMAXPROCS.
+// Cannot be changed with ResetWithOptions.
+func ( int) EOption {
+returnfunc( *encoderOptions) error {
+if < 0 {
+returnerrors.New("concurrency must at least 0")
+ }
+if == 0 {
+ = runtime.GOMAXPROCS(0)
+ }
+if .resetOpt && != .concurrent {
+returnerrors.New("WithEncoderConcurrency cannot be changed on Reset")
+ }
+ .concurrent =
+returnnil
+ }
+}
+
+// WithWindowSize will set the maximum allowed back-reference distance.
+// The value must be a power of two between MinWindowSize and MaxWindowSize.
+// A larger value will enable better compression but allocate more memory and,
+// for above-default values, take considerably longer.
+// The default value is determined by the compression level and max 8MB.
+// Cannot be changed with ResetWithOptions.
+func ( int) EOption {
+returnfunc( *encoderOptions) error {
+switch {
+case < MinWindowSize:
+returnfmt.Errorf("window size must be at least %d", MinWindowSize)
+case > MaxWindowSize:
+returnfmt.Errorf("window size must be at most %d", MaxWindowSize)
+case ( & ( - 1)) != 0:
+returnerrors.New("window size must be a power of 2")
+ }
+if .resetOpt && != .windowSize {
+returnerrors.New("WithWindowSize cannot be changed on Reset")
+ }
+
+ .windowSize =
+ .customWindow = true
+if .blockSize > .windowSize {
+ .blockSize = .windowSize
+ .customBlockSize = true
+ }
+returnnil
+ }
+}
+
+// WithEncoderPadding will add padding to all output so the size will be a multiple of n.
+// This can be used to obfuscate the exact output size or make blocks of a certain size.
+// The contents will be a skippable frame, so it will be invisible by the decoder.
+// n must be > 0 and <= 1GB, 1<<30 bytes.
+// The padded area will be filled with data from crypto/rand.Reader.
+// If `EncodeAll` is used with data already in the destination, the total size will be multiple of this.
+// Can be changed with ResetWithOptions.
+func ( int) EOption {
+returnfunc( *encoderOptions) error {
+if <= 0 {
+returnfmt.Errorf("padding must be at least 1")
+ }
+// No need to waste our time.
+if == 1 {
+ = 0
+ }
+if > 1<<30 {
+returnfmt.Errorf("padding must less than 1GB (1<<30 bytes) ")
+ }
+ .pad =
+returnnil
+ }
+}
+
+// EncoderLevel predefines encoder compression levels.
+// Only use the constants made available, since the actual mapping
+// of these values are very likely to change and your compression could change
+// unpredictably when upgrading the library.
+typeEncoderLevelint
+
+const (
+speedNotSetEncoderLevel = iota
+
+// SpeedFastest will choose the fastest reasonable compression.
+ // This is roughly equivalent to the fastest Zstandard mode.
+SpeedFastest
+
+// SpeedDefault is the default "pretty fast" compression option.
+ // This is roughly equivalent to the default Zstandard mode (level 3).
+SpeedDefault
+
+// SpeedBetterCompression will yield better compression than the default.
+ // Currently it is about zstd level 7-8 with ~ 2x-3x the default CPU usage.
+ // By using this, notice that CPU usage may go up in the future.
+SpeedBetterCompression
+
+// SpeedBestCompression will choose the best available compression option.
+ // This will offer the best compression no matter the CPU cost.
+SpeedBestCompression
+
+// speedLast should be kept as the last actual compression option.
+ // The is not for external usage, but is used to keep track of the valid options.
+speedLast
+)
+
+// EncoderLevelFromString will convert a string representation of an encoding level back
+// to a compression level. The compare is not case sensitive.
+// If the string wasn't recognized, (false, SpeedDefault) will be returned.
+func ( string) (bool, EncoderLevel) {
+for := speedNotSet + 1; < speedLast; ++ {
+ifstrings.EqualFold(, .String()) {
+returntrue,
+ }
+ }
+returnfalse, SpeedDefault
+}
+
+// EncoderLevelFromZstd will return an encoder level that closest matches the compression
+// ratio of a specific zstd compression level.
+// Many input values will provide the same compression level.
+func ( int) EncoderLevel {
+switch {
+case < 3:
+returnSpeedFastest
+case >= 3 && < 6:
+returnSpeedDefault
+case >= 6 && < 10:
+returnSpeedBetterCompression
+default:
+returnSpeedBestCompression
+ }
+}
+
+// String provides a string representation of the compression level.
+func ( EncoderLevel) () string {
+switch {
+caseSpeedFastest:
+return"fastest"
+caseSpeedDefault:
+return"default"
+caseSpeedBetterCompression:
+return"better"
+caseSpeedBestCompression:
+return"best"
+default:
+return"invalid"
+ }
+}
+
+// WithEncoderLevel specifies a predefined compression level.
+// Cannot be changed with ResetWithOptions.
+func ( EncoderLevel) EOption {
+returnfunc( *encoderOptions) error {
+switch {
+case <= speedNotSet || >= speedLast:
+returnfmt.Errorf("unknown encoder level")
+ }
+if .resetOpt && != .level {
+returnerrors.New("WithEncoderLevel cannot be changed on Reset")
+ }
+ .level =
+if !.customWindow {
+switch .level {
+caseSpeedFastest:
+ .windowSize = 4 << 20
+if !.customBlockSize {
+ .blockSize = 1 << 16
+ }
+caseSpeedDefault:
+ .windowSize = 8 << 20
+caseSpeedBetterCompression:
+ .windowSize = 8 << 20
+caseSpeedBestCompression:
+ .windowSize = 8 << 20
+ }
+ }
+if !.customALEntropy {
+ .allLitEntropy = > SpeedDefault
+ }
+
+returnnil
+ }
+}
+
+// WithZeroFrames will encode 0 length input as full frames.
+// This can be needed for compatibility with zstandard usage,
+// but is not needed for this package.
+// Can be changed with ResetWithOptions.
+func ( bool) EOption {
+returnfunc( *encoderOptions) error {
+ .fullZero =
+returnnil
+ }
+}
+
+// WithAllLitEntropyCompression will apply entropy compression if no matches are found.
+// Disabling this will skip incompressible data faster, but in cases with no matches but
+// skewed character distribution compression is lost.
+// Default value depends on the compression level selected.
+// Can be changed with ResetWithOptions.
+func ( bool) EOption {
+returnfunc( *encoderOptions) error {
+ .customALEntropy = true
+ .allLitEntropy =
+returnnil
+ }
+}
+
+// WithNoEntropyCompression will always skip entropy compression of literals.
+// This can be useful if content has matches, but unlikely to benefit from entropy
+// compression. Usually the slight speed improvement is not worth enabling this.
+// Can be changed with ResetWithOptions.
+func ( bool) EOption {
+returnfunc( *encoderOptions) error {
+ .noEntropy =
+returnnil
+ }
+}
+
+// WithSingleSegment will set the "single segment" flag when EncodeAll is used.
+// If this flag is set, data must be regenerated within a single continuous memory segment.
+// In this case, Window_Descriptor byte is skipped, but Frame_Content_Size is necessarily present.
+// As a consequence, the decoder must allocate a memory segment of size equal or larger than size of your content.
+// In order to preserve the decoder from unreasonable memory requirements,
+// a decoder is allowed to reject a compressed frame which requests a memory size beyond decoder's authorized range.
+// For broader compatibility, decoders are recommended to support memory sizes of at least 8 MB.
+// This is only a recommendation, each decoder is free to support higher or lower limits, depending on local limitations.
+// If this is not specified, block encodes will automatically choose this based on the input size and the window size.
+// This setting has no effect on streamed encodes.
+// Can be changed with ResetWithOptions.
+func ( bool) EOption {
+returnfunc( *encoderOptions) error {
+ .single = &
+returnnil
+ }
+}
+
+// WithLowerEncoderMem will trade in some memory cases trade less memory usage for
+// slower encoding speed.
+// This will not change the window size which is the primary function for reducing
+// memory usage. See WithWindowSize.
+// Cannot be changed with ResetWithOptions.
+func ( bool) EOption {
+returnfunc( *encoderOptions) error {
+if .resetOpt && != .lowMem {
+returnerrors.New("WithLowerEncoderMem cannot be changed on Reset")
+ }
+ .lowMem =
+returnnil
+ }
+}
+
+// WithConcurrentBlocks enables job-based parallel compression for streams.
+// When enabled and concurrent > 1, input is split into large sections (jobs)
+// that are compressed simultaneously by multiple goroutines.
+// Each non-first job receives an overlap prefix from the previous job for match context.
+// Output is flushed in order, producing a valid single-frame zstd stream.
+//
+// Currently disabled when used with dictionary encoding.
+// Cannot be changed with ResetWithOptions.
+func ( bool) EOption {returnfunc( *encoderOptions) error {
- , := loadDict()
-if != nil {
-return
- }
- .dict =
-returnnil
- }
-}
-
-// WithEncoderDictRaw registers a dictionary that may be used by the encoder.
-//
-// The slice content may contain arbitrary data. It will be used as an initial
-// history.
-// Can be changed with ResetWithOptions.
-func ( uint32, []byte) EOption {
-returnfunc( *encoderOptions) error {
-ifbits.UintSize > 32 && uint(len()) > dictMaxLength {
-returnfmt.Errorf("dictionary of size %d > 2GiB too large", len())
- }
- .dict = &dict{id: , content: , offsets: [3]int{1, 4, 8}}
-returnnil
- }
-}
-
-// WithEncoderDictDelete clears the dictionary, so no dictionary will be used.
-// Should be used with ResetWithOptions.
-func () EOption {
-returnfunc( *encoderOptions) error {
- .dict = nil
-returnnil
- }
-}
+if .resetOpt && != .concurrentBlocks {
+returnerrors.New("WithConcurrentBlocks cannot be changed on Reset")
+ }
+ .concurrentBlocks =
+returnnil
+ }
+}
+
+// jobSize returns the input section size per parallel job.
+func ( *encoderOptions) () int {
+ := max(.windowSize*4, 512<<10)
+return
+}
+
+// overlapSize returns the overlap prefix size for parallel jobs.
+func ( *encoderOptions) () int {
+switch .level {
+caseSpeedBestCompression:
+return .windowSize / 2
+caseSpeedBetterCompression:
+return .windowSize / 4
+default:
+return .windowSize / 8
+ }
+}
+
+// WithEncoderDict allows to register a dictionary that will be used for the encode.
+//
+// The slice dict must be in the [dictionary format] produced by
+// "zstd --train" from the Zstandard reference implementation.
+//
+// The encoder *may* choose to use no dictionary instead for certain payloads.
+// Can be changed with ResetWithOptions.
+//
+// [dictionary format]: https://github.com/facebook/zstd/blob/dev/doc/zstd_compression_format.md#dictionary-format
+func ( []byte) EOption {
+returnfunc( *encoderOptions) error {
+ , := loadDict()
+if != nil {
+return
+ }
+ .dict =
+returnnil
+ }
+}
+
+// WithEncoderDictRaw registers a dictionary that may be used by the encoder.
+//
+// The slice content may contain arbitrary data. It will be used as an initial
+// history.
+// Can be changed with ResetWithOptions.
+func ( uint32, []byte) EOption {
+returnfunc( *encoderOptions) error {
+ifbits.UintSize > 32 && uint(len()) > dictMaxLength {
+returnfmt.Errorf("dictionary of size %d > 2GiB too large", len())
+ }
+ .dict = &dict{id: , content: , offsets: [3]int{1, 4, 8}}
+returnnil
+ }
+}
+
+// WithEncoderDictDelete clears the dictionary, so no dictionary will be used.
+// Should be used with ResetWithOptions.
+func () EOption {
+returnfunc( *encoderOptions) error {
+ .dict = nil
+returnnil
+ }
+}
The pages are generated with Goldsv0.8.4. (GOOS=linux GOARCH=amd64)
+Golds is a Go 101 project developed by Tapir Liu.
+PR and bug reports are welcome and can be submitted to the issue list.
+Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds.
The pages are generated with Goldsv0.8.4. (GOOS=linux GOARCH=amd64)
+Golds is a Go 101 project developed by Tapir Liu.
+PR and bug reports are welcome and can be submitted to the issue list.
+Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds.
Packages
Total 306 packages, 196 of them are standard packages.
- Total 4847 source files, 4757 of them are Go source files.
- Total 1580320 lines of Go code.
+ Total 4850 source files, 4760 of them are Go source files.
+ Total 1581407 lines of Go code.
Averagely,
- each Go source file imports 7.16 packages and contains 332 lines of code.
- - each package depends 6.68 other packages and contains 15.55 source files.
+ - each package depends 6.68 other packages and contains 15.56 source files.
github.com/refraction-networking/utls
Types
- Total 5708 exported type names, 28 of them are aliases.
- In them, 5519 are composite types and 189 are basic types.
+ Total 5709 exported type names, 28 of them are aliases.
+ In them, 5520 are composite types and 189 are basic types.
In the basic types, 167 are integers (85 are unsigneds).
- In 3596 exported struct types, 68 have embedded fields,
+ In 3597 exported struct types, 68 have embedded fields,
and 59 have promoted fields.
The pages are generated with Goldsv0.8.4. (GOOS=linux GOARCH=amd64)
diff --git a/use/context..Background.html b/use/context..Background.html
index 241c4e6b83f..fe5d2f8e3b1 100644
--- a/use/context..Background.html
+++ b/use/context..Background.html
@@ -11,7 +11,7 @@
func context.Background
-2989 uses
+2990 uses
context (current package)
context.go#L215: func Background() Context {
@@ -80,8 +80,8 @@
handle_result.go#L16: ctx := context.Background()
handle_session_created.go#L15: ctx := context.Background()
new_encrypted_msg.go#L64: logger.Debug(context.Background(), "Request", log.Int64("msg_id", id))
- ping.go#L43: c.log.Debug(context.Background(), "Pong")
- read.go#L108: c.log.Debug(context.Background(), "No updates")
+ ping.go#L44: c.log.Debug(context.Background(), "Pong")
+ read.go#L118: c.log.Debug(context.Background(), "No updates")
rpc.go#L51: ctx, cancel := context.WithTimeout(context.Background(),
salt.go#L21: c.log.Info(context.Background(), "Salt updated", log.Int64("old", oldSalt), log.Int64("new", salt))
@@ -90,16 +90,17 @@
ack.go#L30: ctx := context.Background()
engine.go#L46: logger.Info(context.Background(), "Initialized",
engine.go#L51: reqCtx, reqCancel := context.WithCancelCause(context.Background())
- engine.go#L269: e.log.Warn(context.Background(), "rpc callback not set", log.Int64("msg_id", msgID))
- engine.go#L282: e.log.Warn(context.Background(), "rpc callback not set", log.Int64("msg_id", msgID))
- engine.go#L297: e.log.Info(context.Background(), "Close called")
+ engine.go#L277: e.log.Warn(context.Background(), "rpc callback not set (result for unknown/expired request)",
+ engine.go#L293: e.log.Warn(context.Background(), "rpc callback not set", log.Int64("msg_id", msgID))
+ engine.go#L308: e.log.Info(context.Background(), "Close called")
github.com/gotd/td/telegramcdn_conn_dead.go#L17: c.log.Warn(context.Background(), "Resetting cached CDN keys after fingerprint miss",
cdn_conn_dead.go#L48: c.log.Warn(context.Background(), "Dropping stored CDN session key after PFS key reset request",
- connect.go#L124: c.log.Info(context.Background(), "Restarting connection", log.Error(err), log.Duration("backoff", timeout))
- connect.go#L136: c.log.Debug(context.Background(), "Ready")
- connect.go#L172: defer c.log.Info(context.Background(), "Closed")
+ connect.go#L125: c.log.Info(context.Background(), "Restarting connection", log.Error(err), log.Duration("backoff", timeout))
+ connect.go#L133: c.log.Debug(context.Background(), "Primary connection replaced after restart")
+ connect.go#L138: c.log.Debug(context.Background(), "Ready")
+ connect.go#L174: defer c.log.Info(context.Background(), "Closed")
pfs.go#L21: c.log.Warn(context.Background(), "Dropping stored primary session key after PFS key reset request",
pfs.go#L42: c.log.Warn(context.Background(), "Dropping stored DC session key after PFS key reset request",
diff --git a/use/context..Canceled.html b/use/context..Canceled.html
index f0c7fc36c56..910ad8ff43b 100644
--- a/use/context..Canceled.html
+++ b/use/context..Canceled.html
@@ -22,12 +22,12 @@
context.go#L656: return c, func() { c.cancel(true, Canceled, nil) }
github.com/gotd/td/rpc
- engine.go#L241: if errors.Is(err, context.Canceled) {
+ engine.go#L246: if errors.Is(err, context.Canceled) {
github.com/gotd/td/telegram
- connect.go#L186: if closeErr := conn.Close(); !errors.Is(closeErr, context.Canceled) {
- connect.go#L191: if closeErr := conn.Close(); !errors.Is(closeErr, context.Canceled) {
- connect.go#L231: if err := g.Wait(); !errors.Is(err, context.Canceled) {
+ connect.go#L188: if closeErr := conn.Close(); !errors.Is(closeErr, context.Canceled) {
+ connect.go#L193: if closeErr := conn.Close(); !errors.Is(closeErr, context.Canceled) {
+ connect.go#L233: if err := g.Wait(); !errors.Is(err, context.Canceled) {
github.com/gotd/td/telegram/downloadercdn_state_machine.go#L126: if errors.Is(err, context.Canceled) || errors.Is(err, context.DeadlineExceeded) {
diff --git a/use/context..Cause.html b/use/context..Cause.html
index 959d81998fb..ffc6ced88a3 100644
--- a/use/context..Cause.html
+++ b/use/context..Cause.html
@@ -20,7 +20,7 @@
context.go#L525: child.cancel(false, parent.Err(), Cause(parent))
github.com/gotd/td/rpc
- engine.go#L232: return errors.Wrap(context.Cause(e.reqCtx), "engine forcibly closed")
+ engine.go#L237: return errors.Wrap(context.Cause(e.reqCtx), "engine forcibly closed")
net/httptransport.go#L677: return nil, context.Cause(ctx)
diff --git a/use/context..Context.Done.html b/use/context..Context.Done.html
index 4cd8715fdaa..1d53c93bcf5 100644
--- a/use/context..Context.Done.html
+++ b/use/context..Context.Done.html
@@ -34,16 +34,16 @@
conn.go#L290: case <-ctx.Done():
github.com/gotd/td/mtproto
- ack.go#L32: case <-ctx.Done():
+ ack.go#L38: case <-ctx.Done():
conn.go#L192: <-ctx.Done()
pfs.go#L22: <-ctx.Done()
pfs.go#L45: case <-ctx.Done():
- ping.go#L33: case <-ctx.Done():
- ping.go#L77: case <-ctx.Done():
- ping.go#L106: case <-ctx.Done():
- read.go#L94: case <-ctx.Done():
- read.go#L177: case <-ctx.Done():
- read.go#L195: case <-ctx.Done():
+ ping.go#L34: case <-ctx.Done():
+ ping.go#L78: case <-ctx.Done():
+ ping.go#L108: case <-ctx.Done():
+ read.go#L98: case <-ctx.Done():
+ read.go#L187: case <-ctx.Done():
+ read.go#L205: case <-ctx.Done():
salt.go#L53: case <-ctx.Done():
salt.go#L70: case <-ctx.Done():
@@ -54,10 +54,10 @@
pool.go#L224: case <-c.ctx.Done():
github.com/gotd/td/rpc
- engine.go#L153: case <-ctx.Done():
- engine.go#L175: case <-e.reqCtx.Done():
- engine.go#L219: case <-ctx.Done():
- engine.go#L221: case <-e.reqCtx.Done():
+ engine.go#L155: case <-ctx.Done():
+ engine.go#L178: case <-e.reqCtx.Done():
+ engine.go#L224: case <-ctx.Done():
+ engine.go#L226: case <-e.reqCtx.Done():
github.com/gotd/td/telegrambot.go#L13: <-ctx.Done()
@@ -65,12 +65,12 @@
cdn.go#L174: case <-ctx.Done():
connect.go#L39: case <-ctx.Done():
connect.go#L80: case <-ctx.Done():
- connect.go#L161: case <-c.ctx.Done():
- connect.go#L209: case <-ctx.Done():
- connect.go#L212: case <-c.ctx.Done():
- connect.go#L218: case <-ctx.Done():
- invoke.go#L106: clientDone = c.ctx.Done()
- invoke.go#L112: case <-ctx.Done():
+ connect.go#L163: case <-c.ctx.Done():
+ connect.go#L211: case <-ctx.Done():
+ connect.go#L214: case <-c.ctx.Done():
+ connect.go#L220: case <-ctx.Done():
+ invoke.go#L107: clientDone = c.ctx.Done()
+ invoke.go#L115: case <-ctx.Done():
migrate_to_dc.go#L16: case <-ctx.Done():
migrate_to_dc.go#L23: case <-ctx.Done():
migrate_to_dc.go#L35: case <-ctx.Done():
@@ -93,7 +93,7 @@
stream.go#L38: case <-ctx.Done():
github.com/gotd/td/telegram/internal/manager
- conn.go#L188: case <-ctx.Done():
+ conn.go#L203: case <-ctx.Done():
github.com/gotd/td/tgerrflood_wait.go#L71: case <-ctx.Done():
diff --git a/use/context..Context.Err.html b/use/context..Context.Err.html
index e6c333c2a41..f5d9b4d5d20 100644
--- a/use/context..Context.Err.html
+++ b/use/context..Context.Err.html
@@ -11,7 +11,7 @@
func errors.New
-1779 uses
+1785 uses
errors (current package)
errors.go#L64: func New(text string) error {
@@ -1024,6 +1024,10 @@
bitreader.go#L36: return errors.New("corrupt stream, did not find end of stream")
bitreader.go#L138: return errors.New("corrupt stream: too short")
bitreader.go#L145: return errors.New("corrupt stream, did not find end of stream")
+ build_table.go#L19: return errors.New("huff0: BuildCTable on nil Scratch")
+ build_table.go#L22: return errors.New("huff0: nil count passed to BuildCTable")
+ build_table.go#L42: return errors.New("huff0: empty histogram")
+ build_table.go#L143: return dst, errors.New("huff0: AppendTable with empty table")
decompress.go#L35: return s, nil, errors.New("input too small for table")
decompress.go#L44: return s, nil, errors.New("input too small for table")
decompress.go#L67: return s, nil, errors.New("corrupt input: output table too large")
@@ -1080,13 +1084,15 @@
dict.go#L86: return nil, errors.New("dictionaries cannot have ID 0")
dict.go#L141: return nil, errors.New("invalid offset in dictionary")
dict.go#L220: return nil, errors.New("no content provided")
- encoder.go#L462: return errors.New("zstd: encoder has no writer")
- encoder_options.go#L91: return errors.New("concurrency must at least 0")
- encoder_options.go#L97: return errors.New("WithEncoderConcurrency cannot be changed on Reset")
- encoder_options.go#L118: return errors.New("window size must be a power of 2")
- encoder_options.go#L121: return errors.New("WithWindowSize cannot be changed on Reset")
- encoder_options.go#L242: return errors.New("WithEncoderLevel cannot be changed on Reset")
- encoder_options.go#L329: return errors.New("WithLowerEncoderMem cannot be changed on Reset")
+ encoder.go#L601: return errors.New("zstd: encoder has no writer")
+ encoder.go#L666: return errors.New("zstd: encoder has no writer")
+ encoder_options.go#L92: return errors.New("concurrency must at least 0")
+ encoder_options.go#L98: return errors.New("WithEncoderConcurrency cannot be changed on Reset")
+ encoder_options.go#L119: return errors.New("window size must be a power of 2")
+ encoder_options.go#L122: return errors.New("WithWindowSize cannot be changed on Reset")
+ encoder_options.go#L243: return errors.New("WithEncoderLevel cannot be changed on Reset")
+ encoder_options.go#L330: return errors.New("WithLowerEncoderMem cannot be changed on Reset")
+ encoder_options.go#L348: return errors.New("WithConcurrentBlocks cannot be changed on Reset")
framedec.go#L135: return errors.New("reserved bit set on frame header")
fse_decoder.go#L58: return errors.New("input too small")
fse_decoder.go#L64: return errors.New("tableLog too large")
diff --git a/use/fmt..Errorf.html b/use/fmt..Errorf.html
index bdc4f024399..8b32d80703e 100644
--- a/use/fmt..Errorf.html
+++ b/use/fmt..Errorf.html
@@ -11,7 +11,7 @@
func fmt.Errorf
-27555 uses
+27557 uses
fmt (current package)
errors.go#L23: func Errorf(format string, a ...any) (err error) {
@@ -27306,18 +27306,20 @@
dict.go#L146: return nil, fmt.Errorf("initial offset bigger than dictionary content size %d, offsets: %v", len(d.content), d.offsets)
dict.go#L214: return nil, fmt.Errorf("dictionary of size %d > %d", len(hist), int64(dictMaxLength))
dict.go#L217: return nil, fmt.Errorf("dictionary of size %d < %d", len(hist), 8)
- dict.go#L337: return nil, fmt.Errorf("%d blocks, %d sequences found", nUsed, seqs)
+ dict.go#L338: return nil, fmt.Errorf("%d blocks, %d sequences found", nUsed, seqs)
enc_base.go#L67: panic(fmt.Errorf("unexpected buffer cap %d, want at least %d with window %d", cap(e.hist), e.maxMatchOff+maxCompressedBlockSize, e.maxMatchOff))
- encoder.go#L221: return fmt.Errorf("block > maxStoreBlockSize")
- encoder.go#L327: s.err = fmt.Errorf("panic while encoding: %v", r)
- encoder.go#L351: s.writeErr = fmt.Errorf("panic while encoding/writing: %v", r)
- encoder.go#L473: return fmt.Errorf("frame content size %d given, but %d bytes was written", s.frameContentSize, s.nInput)
- encoder_options.go#L114: return fmt.Errorf("window size must be at least %d", MinWindowSize)
- encoder_options.go#L116: return fmt.Errorf("window size must be at most %d", MaxWindowSize)
- encoder_options.go#L144: return fmt.Errorf("padding must be at least 1")
- encoder_options.go#L151: return fmt.Errorf("padding must less than 1GB (1<<30 bytes) ")
- encoder_options.go#L239: return fmt.Errorf("unknown encoder level")
- encoder_options.go#L364: return fmt.Errorf("dictionary of size %d > 2GiB too large", len(content))
+ enc_jobs.go#L83: job.err = fmt.Errorf("panic in parallel job: %v", r)
+ encoder.go#L293: return fmt.Errorf("block > maxStoreBlockSize")
+ encoder.go#L399: s.err = fmt.Errorf("panic while encoding: %v", r)
+ encoder.go#L423: s.writeErr = fmt.Errorf("panic while encoding/writing: %v", r)
+ encoder.go#L613: return fmt.Errorf("frame content size %d given, but %d bytes was written", s.frameContentSize, s.nInput)
+ encoder.go#L679: return fmt.Errorf("frame content size %d given, but %d bytes was written", s.frameContentSize, s.nInput)
+ encoder_options.go#L115: return fmt.Errorf("window size must be at least %d", MinWindowSize)
+ encoder_options.go#L117: return fmt.Errorf("window size must be at most %d", MaxWindowSize)
+ encoder_options.go#L145: return fmt.Errorf("padding must be at least 1")
+ encoder_options.go#L152: return fmt.Errorf("padding must less than 1GB (1<<30 bytes) ")
+ encoder_options.go#L240: return fmt.Errorf("unknown encoder level")
+ encoder_options.go#L401: return fmt.Errorf("dictionary of size %d > 2GiB too large", len(content))
frameenc.go#L125: return dst, fmt.Errorf("requested skippable frame (%d) < 8", total)
frameenc.go#L128: return dst, fmt.Errorf("requested skippable frame (%d) > max uint32", total)
fse_decoder.go#L168: return fmt.Errorf("symbolLen (%d) too small", s.symbolLen)
@@ -27327,10 +27329,10 @@
fse_decoder.go#L180: return fmt.Errorf("corruption detected (total %d != %d)", gotTotal, 1<<s.actualTableLog)
fse_decoder.go#L258: return 0, fmt.Errorf("rle symbol %d >= max %d", symb, len(t))
fse_decoder.go#L280: return fmt.Errorf("invalid decoding table entry %d, symbol %d >= max (%d)", i, v.addBits(), len(t))
- fse_decoder_amd64.go#L47: return fmt.Errorf("corrupted input (position=%d, expected 0)", position)
- fse_decoder_amd64.go#L52: return fmt.Errorf("newState (%d) outside table size (%d)", newState, size)
- fse_decoder_amd64.go#L57: return fmt.Errorf("newState (%d) == oldState (%d) and no bits", newState, oldState)
- fse_decoder_amd64.go#L60: return fmt.Errorf("buildDtable_asm returned unhandled nonzero code = %d", code)
+ fse_decoder_asm.go#L51: return fmt.Errorf("corrupted input (position=%d, expected 0)", position)
+ fse_decoder_asm.go#L56: return fmt.Errorf("newState (%d) outside table size (%d)", newState, size)
+ fse_decoder_asm.go#L61: return fmt.Errorf("newState (%d) == oldState (%d) and no bits", newState, oldState)
+ fse_decoder_asm.go#L64: return fmt.Errorf("buildDtable_asm returned unhandled nonzero code = %d", code)
fse_encoder.go#L135: return fmt.Errorf("internal error: expected cumul[s.symbolLen] (%d) == tableSize (%d)", cumul[s.symbolLen], tableSize)
fse_encoder.go#L200: return fmt.Errorf("total mismatch %d (got) != %d (want)", total, tableSize)
fse_encoder.go#L476: return fmt.Errorf("warning: Total == %d != %d", total, 1<<s.actualTableLog)
@@ -27349,22 +27351,22 @@
seqdec.go#L347: return fmt.Errorf("match offset (%d) bigger than current history (%d)", mo, len(out)+len(hist)-startSize)
seqdec.go#L353: return fmt.Errorf("match offset (%d) bigger than current history (%d)", mo, len(out)+len(hist)-startSize)
seqdec.go#L428: return fmt.Errorf("output bigger than max block size (%d)", maxBlockSize)
- seqdec_amd64.go#L121: return true, fmt.Errorf("zero matchoff and matchlen (%d) > 0", ctx.ml)
- seqdec_amd64.go#L124: return true, fmt.Errorf("match len (%d) bigger than max allowed length", ctx.ml)
- seqdec_amd64.go#L127: return true, fmt.Errorf("match offset (%d) bigger than current history (%d)",
- seqdec_amd64.go#L131: return true, fmt.Errorf("unexpected literal count, want %d bytes, but only %d is available",
- seqdec_amd64.go#L142: return true, fmt.Errorf("output bigger than max block size (%d)", maxBlockSize)
- seqdec_amd64.go#L145: return true, fmt.Errorf("sequenceDecs_decode returned erroneous code %d", errCode)
- seqdec_amd64.go#L150: return true, fmt.Errorf("output bigger than max block size (%d)", maxBlockSize)
- seqdec_amd64.go#L167: panic(fmt.Errorf("length mismatch, want %d, got %d", len(s.out), t))
- seqdec_amd64.go#L275: return fmt.Errorf("zero matchoff and matchlen (%d) > 0", ml)
- seqdec_amd64.go#L279: return fmt.Errorf("match len (%d) bigger than max allowed length", ml)
- seqdec_amd64.go#L283: return fmt.Errorf("unexpected literal count, want %d bytes, but only %d is available", ll, ctx.litRemain+ll)
- seqdec_amd64.go#L288: return fmt.Errorf("sequenceDecs_decode_amd64 returned erroneous code %d", errCode)
- seqdec_amd64.go#L292: return fmt.Errorf("literal count is too big: total available %d, total requested %d",
- seqdec_amd64.go#L298: return fmt.Errorf("output bigger than max block size (%d)", maxBlockSize)
- seqdec_amd64.go#L370: return fmt.Errorf("match offset (%d) bigger than current history (%d)",
- seqdec_amd64.go#L381: panic(fmt.Errorf("length mismatch, want %d, got %d, ss: %d", len(out), t, s.seqSize))
+ seqdec_asm.go#L122: return true, fmt.Errorf("zero matchoff and matchlen (%d) > 0", ctx.ml)
+ seqdec_asm.go#L125: return true, fmt.Errorf("match len (%d) bigger than max allowed length", ctx.ml)
+ seqdec_asm.go#L128: return true, fmt.Errorf("match offset (%d) bigger than current history (%d)",
+ seqdec_asm.go#L132: return true, fmt.Errorf("unexpected literal count, want %d bytes, but only %d is available",
+ seqdec_asm.go#L143: return true, fmt.Errorf("output bigger than max block size (%d)", maxBlockSize)
+ seqdec_asm.go#L146: return true, fmt.Errorf("sequenceDecs_decode returned erroneous code %d", errCode)
+ seqdec_asm.go#L151: return true, fmt.Errorf("output bigger than max block size (%d)", maxBlockSize)
+ seqdec_asm.go#L168: panic(fmt.Errorf("length mismatch, want %d, got %d", len(s.out), t))
+ seqdec_asm.go#L205: return fmt.Errorf("zero matchoff and matchlen (%d) > 0", ml)
+ seqdec_asm.go#L209: return fmt.Errorf("match len (%d) bigger than max allowed length", ml)
+ seqdec_asm.go#L213: return fmt.Errorf("unexpected literal count, want %d bytes, but only %d is available", ll, ctx.litRemain+ll)
+ seqdec_asm.go#L218: return fmt.Errorf("sequenceDecs_decode_amd64 returned erroneous code %d", errCode)
+ seqdec_asm.go#L222: return fmt.Errorf("literal count is too big: total available %d, total requested %d",
+ seqdec_asm.go#L228: return fmt.Errorf("output bigger than max block size (%d)", maxBlockSize)
+ seqdec_asm.go#L272: return fmt.Errorf("match offset (%d) bigger than current history (%d)",
+ seqdec_asm.go#L283: panic(fmt.Errorf("length mismatch, want %d, got %d, ss: %d", len(out), t, s.seqSize))
github.com/refraction-networking/utlsauth.go#L27: return fmt.Errorf("expected an ECDSA public key, got %T", pubkey)
diff --git a/use/fmt..Println.html b/use/fmt..Println.html
index def3fa96784..001ccbca36f 100644
--- a/use/fmt..Println.html
+++ b/use/fmt..Println.html
@@ -24,19 +24,19 @@
huffman_bit_writer.go#L1086: fmt.Println("header:", count/8)
huffman_bit_writer.go#L1162: fmt.Println("wrote", nb, "bits,", nb/8, "bytes.")
inflate.go#L173: fmt.Println("coding failed, code, max:", code, max, code == 1<<uint(max), code == 1 && max == 1, "(one should be true)")
- inflate.go#L362: fmt.Println("stored block")
- inflate.go#L370: fmt.Println("predefinied huffman block")
- inflate.go#L381: fmt.Println("dynamic huffman block")
- inflate.go#L386: fmt.Println("reserved data block encountered")
- inflate.go#L469: fmt.Println("nlit > maxNumLit", nlit)
- inflate.go#L477: fmt.Println("ndist > maxNumDist", ndist)
- inflate.go#L503: fmt.Println("init codebits failed")
- inflate.go#L533: fmt.Println("i==0")
- inflate.go#L550: fmt.Println("morebits:", err)
- inflate.go#L560: fmt.Println("i+rep > n", i, rep, n)
- inflate.go#L572: fmt.Println("init2 failed")
- inflate.go#L624: fmt.Println("uint16(nn) != uint16(^n)", nn, ncomp)
- inflate.go#L756: fmt.Println("huffsym: n==0")
+ inflate.go#L367: fmt.Println("stored block")
+ inflate.go#L375: fmt.Println("predefinied huffman block")
+ inflate.go#L386: fmt.Println("dynamic huffman block")
+ inflate.go#L391: fmt.Println("reserved data block encountered")
+ inflate.go#L474: fmt.Println("nlit > maxNumLit", nlit)
+ inflate.go#L482: fmt.Println("ndist > maxNumDist", ndist)
+ inflate.go#L508: fmt.Println("init codebits failed")
+ inflate.go#L538: fmt.Println("i==0")
+ inflate.go#L555: fmt.Println("morebits:", err)
+ inflate.go#L565: fmt.Println("i+rep > n", i, rep, n)
+ inflate.go#L577: fmt.Println("init2 failed")
+ inflate.go#L629: fmt.Println("uint16(nn) != uint16(^n)", nn, ncomp)
+ inflate.go#L773: fmt.Println("huffsym: n==0")
inflate_gen.go#L69: fmt.Println("huffsym: n==0")
inflate_gen.go#L110: fmt.Println("morebits n>0:", err)
inflate_gen.go#L124: fmt.Println(v, ">= maxNumLit")
diff --git a/use/github.com/cenkalti/backoff/v4..BackOff.Reset.html b/use/github.com/cenkalti/backoff/v4..BackOff.Reset.html
index 9b557398d1f..b10515d58fb 100644
--- a/use/github.com/cenkalti/backoff/v4..BackOff.Reset.html
+++ b/use/github.com/cenkalti/backoff/v4..BackOff.Reset.html
@@ -23,7 +23,7 @@
backoff.go#L24: s.b.Reset()
github.com/gotd/td/telegram
- connect.go#L141: (*b).Reset()
+ connect.go#L143: (*b).Reset()
The pages are generated with Goldsv0.8.4. (GOOS=linux GOARCH=amd64)
diff --git a/use/github.com/cenkalti/backoff/v4..BackOffContext.Reset.html b/use/github.com/cenkalti/backoff/v4..BackOffContext.Reset.html
index 9f0087b7dfe..91f173601d0 100644
--- a/use/github.com/cenkalti/backoff/v4..BackOffContext.Reset.html
+++ b/use/github.com/cenkalti/backoff/v4..BackOffContext.Reset.html
@@ -23,7 +23,7 @@
backoff.go#L24: s.b.Reset()
github.com/gotd/td/telegram
- connect.go#L141: (*b).Reset()
+ connect.go#L143: (*b).Reset()