</pre></div><divclass="public anchor"id="var-*auto-freeze-compressor*"><h3>*auto-freeze-compressor*</h3><h4class="dynamic">dynamic</h4><divclass="usage"></div><divclass="doc"><preclass="plaintext">(fn [byte-array])->compressor used by `(freeze <x> {:compressor :auto}),
</pre></div></div><divclass="public anchor"id="var-*freeze-fallback*"><h3>*freeze-fallback*</h3><h4class="dynamic">dynamic</h4><divclass="usage"></div><divclass="doc"><preclass="plaintext">Controls Nippy's behaviour when trying to freeze an item for which Nippy
doesn't currently have a native freeze/thaw implementation.
Possible values:
1. `nil` (no freeze-fallback, default)
Tries the following in order:
- Freeze with Java's `Serializable` interface if possible
- Freeze with Clojure's reader if possible
- Throw
2. `:write-unfreezable` keyword
Tries the following in order:
- Freeze with Java's `Serializable` interface if possible
- Freeze with Clojure's reader if possible
- Freeze a {:nippy/unfreezable {:type _}} placeholder value
3. [Advanced] Custom (fn [^java.io.DataOutput out item]) that must
write exactly one value to the given `DataOutput` stream</pre></div></div><divclass="public anchor"id="var-*freeze-serializable-allowlist*"><h3>*freeze-serializable-allowlist*</h3><h4class="dynamic">dynamic</h4><divclass="usage"></div><divclass="doc"><preclass="plaintext">Used when attempting to <freeze/thaw> an object that:
[2] See `allow-and-record-any-serializable-class-unsafe`.</pre></div></div><divclass="public anchor"id="var-*incl-metadata.3F*"><h3>*incl-metadata?*</h3><h4class="dynamic">dynamic</h4><divclass="usage"></div><divclass="doc"><preclass="plaintext">Include metadata when freezing/thawing?
</pre></div></div><divclass="public anchor"id="var-*thaw-serializable-allowlist*"><h3>*thaw-serializable-allowlist*</h3><h4class="dynamic">dynamic</h4><divclass="usage"></div><divclass="doc"><preclass="plaintext">Used when attempting to <freeze/thaw> an object that:
[2] See `allow-and-record-any-serializable-class-unsafe`.</pre></div></div><divclass="public anchor"id="var-*thaw-xform*"><h3>*thaw-xform*</h3><h4class="dynamic">dynamic</h4><h4class="added">added in v3.3.0-RC1 (2023-08-02)</h4><divclass="usage"></div><divclass="doc"><preclass="plaintext">Experimental, subject to change. Feedback welcome!
will throw a detailed `ExceptionInfo` with message
"Error thrown via `*thaw-xform*`" to help you debug.</pre></div></div><divclass="public anchor"id="var--cache-proxy"><h3>-cache-proxy</h3><divclass="usage"></div><divclass="doc"><preclass="plaintext">{[<x><meta>] <idx>} for freezing, {<idx><x-with-meta>} for thawing.
</pre></div></div><divclass="public anchor"id="var-aes128-cbc-encryptor"><h3>aes128-cbc-encryptor</h3><divclass="usage"></div><divclass="doc"><preclass="plaintext">Default 128bit AES-CBC encryptor with many-round SHA-512 key-gen.
See also `aes-128-cbc-encryptor`.</pre></div></div><divclass="public anchor"id="var-aes128-encryptor"><h3>aes128-encryptor</h3><divclass="usage"></div><divclass="doc"><preclass="plaintext">Default 128bit AES-GCM encryptor with many-round SHA-512 key-gen.
increased danger if a key is somehow compromised.</pre></div></div><divclass="public anchor"id="var-aes128-gcm-encryptor"><h3>aes128-gcm-encryptor</h3><divclass="usage"></div><divclass="doc"><preclass="plaintext">Default 128bit AES-GCM encryptor with many-round SHA-512 key-gen.
increased danger if a key is somehow compromised.</pre></div></div><divclass="public anchor"id="var-allow-and-record-any-serializable-class-unsafe"><h3>allow-and-record-any-serializable-class-unsafe</h3><divclass="usage"><code>(allow-and-record-any-serializable-class-unsafe class-name)</code></div><divclass="doc"><preclass="plaintext">A predicate (fn allow-class? [class-name]) fn that can be assigned
will incl. a single "foo", plus 2x single-byte references to "foo".</pre></div></div><divclass="public anchor"id="var-compress"><h3>compress</h3><divclass="usage"><code>(compress compressor ba)</code></div><divclass="doc"><preclass="plaintext"></pre></div></div><divclass="public anchor"id="var-decompress"><h3>decompress</h3><divclass="usage"><code>(decompress compressor ba)</code></div><divclass="doc"><preclass="plaintext"></pre></div></div><divclass="public anchor"id="var-decrypt"><h3>decrypt</h3><divclass="usage"><code>(decrypt encryptor pwd ba)</code></div><divclass="doc"><preclass="plaintext"></pre></div></div><divclass="public anchor"id="var-default-freeze-serializable-allowlist"><h3>default-freeze-serializable-allowlist</h3><divclass="usage"></div><divclass="doc"><preclass="plaintext">Allows *any* class-name to be frozen using Java's `Serializable` interface.
This is generally safe since RCE risk is present only when thawing.
See also `*freeze-serializable-allowlist*`.</pre></div></div><divclass="public anchor"id="var-default-thaw-serializable-allowlist"><h3>default-thaw-serializable-allowlist</h3><divclass="usage"></div><divclass="doc"><preclass="plaintext">A set of common safe class-names to allow to be frozen using Java's
See also `*thaw-serializable-allowlist*`.</pre></div></div><divclass="public anchor"id="var-encrypt"><h3>encrypt</h3><divclass="usage"><code>(encrypt encryptor pwd ba)</code></div><divclass="doc"><preclass="plaintext"></pre></div></div><divclass="public anchor"id="var-extend-freeze"><h3>extend-freeze</h3><h4class="type">macro</h4><divclass="usage"><code>(extend-freeze type custom-type-id [x out] & body)</code></div><divclass="doc"><preclass="plaintext">Extends Nippy to support freezing of a custom type (ideally concrete) with
(.writeUTF [data-output] (:data x)))</pre></div></div><divclass="public anchor"id="var-extend-thaw"><h3>extend-thaw</h3><h4class="type">macro</h4><divclass="usage"><code>(extend-thaw custom-type-id [in] & body)</code></div><divclass="doc"><preclass="plaintext">Extends Nippy to support thawing of a custom type with given id:
To freeze custom types, extend the Clojure reader or see `extend-freeze`.</pre></div></div><divclass="public anchor"id="var-freeze-to-file"><h3>freeze-to-file</h3><divclass="usage"><code>(freeze-to-file file x)</code><code>(freeze-to-file file x freeze-opts)</code></div><divclass="doc"><preclass="plaintext">Convenience util: like `freeze`, but writes to `(clojure.java.io/file <file>)`.
</pre></div></div><divclass="public anchor"id="var-freeze-to-out.21"><h3>freeze-to-out!</h3><divclass="usage"><code>(freeze-to-out! data-output x)</code></div><divclass="doc"><preclass="plaintext">Serializes arg (any Clojure data type) to a DataOutput.
This is a low-level util: in most cases you'll want `freeze` instead.</pre></div></div><divclass="public anchor"id="var-freeze-to-string"><h3>freeze-to-string</h3><divclass="usage"><code>(freeze-to-string x)</code><code>(freeze-to-string x freeze-opts)</code></div><divclass="doc"><preclass="plaintext">Convenience util: like `freeze`, but returns a Base64-encoded string.
See also `thaw-from-string`.</pre></div></div><divclass="public anchor"id="var-get-recorded-serializable-classes"><h3>get-recorded-serializable-classes</h3><divclass="usage"><code>(get-recorded-serializable-classes)</code></div><divclass="doc"><preclass="plaintext">Returns {<class-name><frequency>} of the <=1000 classes that ~most
See that function's docstring for more info.</pre></div></div><divclass="public anchor"id="var-IFreezable"><h3>IFreezable</h3><h4class="type">protocol</h4><divclass="usage"></div><divclass="doc"><preclass="plaintext">Private implementation detail.
Protocol that types must implement to support native freezing by Nippy.
Don't use this directly, instead see `extend-freeze`.</pre></div><divclass="members"><h4>members</h4><divclass="inner"><divclass="public anchor"id="var--freezable.3F"><h3>-freezable?</h3><divclass="usage"><code>(-freezable? _)</code></div><divclass="doc"><preclass="plaintext"></pre></div></div><divclass="public anchor"id="var--freeze-without-meta.21"><h3>-freeze-without-meta!</h3><divclass="usage"><code>(-freeze-without-meta! _ data-output)</code></div><divclass="doc"><preclass="plaintext"></pre></div></div></div></div></div><divclass="public anchor"id="var-IFreezableWithMeta"><h3>IFreezableWithMeta</h3><h4class="type">protocol</h4><divclass="usage"></div><divclass="doc"><preclass="plaintext">Private implementation detail.
Wrapper protocol around `IFreezable` used to handle possible metadata.</pre></div><divclass="members"><h4>members</h4><divclass="inner"><divclass="public anchor"id="var--freeze-with-meta.21"><h3>-freeze-with-meta!</h3><divclass="usage"><code>(-freeze-with-meta! _ data-output)</code></div><divclass="doc"><preclass="plaintext"></pre></div></div></div></div></div><divclass="public anchor"id="var-inspect-ba"><h3>inspect-ba</h3><divclass="usage"><code>(inspect-ba ba)</code><code>(inspect-ba ba thaw-opts)</code></div><divclass="doc"><preclass="plaintext">Experimental, subject to change. Feedback welcome!
See `taoensso.nippy-benchmarks` for detailed comparative benchmarks.</pre></div></div><divclass="public anchor"id="var-lzma2-compressor"><h3>lzma2-compressor</h3><divclass="usage"></div><divclass="doc"><preclass="plaintext">Default `LZMA2` compressor:
- Compression ratio: `A+` (0.4 on reference benchmark).
- Compression speed: `E` (18.5 secs on reference benchmark).
- Decompression speed: `D` (11.8 secs on reference benchmark).
Specialized compressor, strongly favours ratio.
See `taoensso.nippy-benchmarks` for detailed comparative benchmarks.</pre></div></div><divclass="public anchor"id="var-public-types-spec"><h3>public-types-spec</h3><divclass="usage"></div><divclass="doc"><preclass="plaintext">Public representation of Nippy's internal type schema.
; Type has payload of <short-count> bytes, then
; <unsigned-int-count>*2 (multiplier) elements
Note that `payload-spec` can be handy for skipping over items in
data stream without fully reading every item.</pre></div></div><divclass="public anchor"id="var-read-quarantined-serializable-object-unsafe.21"><h3>read-quarantined-serializable-object-unsafe!</h3><divclass="usage"><code>(read-quarantined-serializable-object-unsafe! m)</code></div><divclass="doc"><preclass="plaintext">Given a quarantined Serializable object like
See `*thaw-serializable-allowlist*` for more info.</pre></div></div><divclass="public anchor"id="var-snappy-compressor"><h3>snappy-compressor</h3><divclass="usage"></div><divclass="doc"><preclass="plaintext">Default `Snappy` compressor:
- Compression ratio: `C` (0.58 on reference benchmark).
- Compression speed: `A+` (206 msecs on reference benchmark).
- Decompression speed: `B` (134 msecs on reference benchmark).
Good general-purpose compressor, favours speed.
See `taoensso.nippy-benchmarks` for detailed comparative benchmarks.</pre></div></div><divclass="public anchor"id="var-stress-data"><h3>stress-data</h3><divclass="usage"><code>(stress-data {:keys [comparable?], :as opts})</code></div><divclass="doc"><preclass="plaintext">Returns map of reference stress data for use by tests, benchmarks, etc.
</pre></div></div><divclass="public anchor"id="var-thaw"><h3>thaw</h3><divclass="usage"><code>(thaw ba)</code><code>(thaw ba {:as opts, :keys [v1-compatibility? compressor encryptor password serializable-allowlist incl-metadata? thaw-xform], :or {compressor :auto, encryptor :auto}})</code></div><divclass="doc"><preclass="plaintext">Deserializes a frozen Nippy byte array to its original Clojure data type.
:encryptor - :auto (checks header, default), an IEncryptor, or nil</pre></div></div><divclass="public anchor"id="var-thaw-from-file"><h3>thaw-from-file</h3><divclass="usage"><code>(thaw-from-file file)</code><code>(thaw-from-file file thaw-opts)</code></div><divclass="doc"><preclass="plaintext">Convenience util: like `thaw`, but reads from `(clojure.java.io/file <file>)`.
</pre></div></div><divclass="public anchor"id="var-thaw-from-in.21"><h3>thaw-from-in!</h3><divclass="usage"><code>(thaw-from-in! data-input)</code></div><divclass="doc"><preclass="plaintext">Deserializes a frozen object from given DataInput to its original Clojure
This is a low-level util: in most cases you'll want `thaw` instead.</pre></div></div><divclass="public anchor"id="var-thaw-from-resource"><h3>thaw-from-resource</h3><divclass="usage"><code>(thaw-from-resource res)</code><code>(thaw-from-resource res thaw-opts)</code></div><divclass="doc"><preclass="plaintext">Convenience util: like `thaw`, but reads from `(clojure.java.io/resource <res>)`.
</pre></div></div><divclass="public anchor"id="var-thaw-from-string"><h3>thaw-from-string</h3><divclass="usage"><code>(thaw-from-string s)</code><code>(thaw-from-string s thaw-opts)</code></div><divclass="doc"><preclass="plaintext">Convenience util: like `thaw`, but takes a Base64-encoded string.
See also `freeze-to-string`.</pre></div></div><divclass="public anchor"id="var-throw-unfreezable"><h3>throw-unfreezable</h3><divclass="usage"><code>(throw-unfreezable x)</code></div><divclass="doc"><preclass="plaintext"></pre></div></div><divclass="public anchor"id="var-try-write-readable"><h3>try-write-readable</h3><divclass="usage"><code>(try-write-readable out x)</code></div><divclass="doc"><preclass="plaintext"></pre></div></div><divclass="public anchor"id="var-try-write-serializable"><h3>try-write-serializable</h3><divclass="usage"><code>(try-write-serializable out x)</code></div><divclass="doc"><preclass="plaintext"></pre></div></div><divclass="public anchor"id="var-write-id"><h3>write-id</h3><h4class="type">macro</h4><divclass="usage"><code>(write-id out id)</code></div><divclass="doc"><preclass="plaintext"></pre></div></div><divclass="public anchor"id="var-write-unfreezable"><h3>write-unfreezable</h3><divclass="usage"><code>(write-unfreezable out x)</code></div><divclass="doc"><preclass="plaintext"></pre></div></div><divclass="public anchor"id="var-zstd-compressor"><h3>zstd-compressor</h3><divclass="usage"></div><divclass="doc"><preclass="plaintext">Default `Zstd` (`Zstandard`) compressor:
- Compression ratio: `B` (0.53 on reference benchmark).
- Compression speed: `C` (1300 msecs on reference benchmark).
- Decompression speed: `B` (400 msecs on reference benchmark).
Good general-purpose compressor, balances ratio & speed.
See `taoensso.nippy-benchmarks` for detailed comparative benchmarks.</pre></div></div></div></body></html>