</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
to `*freeze-serializable-allowlist*` and/or
`*thaw-serializable-allowlist*` that:
- Will allow ANY class to use Nippy's Serializable support (unsafe).
- And will record {<class-name><frequency-allowed>} for the <=1000
classes that ~most frequently made use of this support.
`get-recorded-serializable-classes` returns the recorded state.
This predicate is provided as a convenience for users upgrading from
previous versions of Nippy that allowed the use of Serializable for all
classes by default.
While transitioning from an unsafe->safe configuration, you can use
this predicate (unsafe) to record information about which classes have
been using Nippy's Serializable support in your environment.
Once some time has passed, you can check the recorded state. If you're
satisfied that all recorded classes are safely Serializable, you can
then merge the recorded classes into Nippy's default allowlist/s, e.g.:
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
Serializable interface. PRs welcome for additions.
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:
way of doing so).</pre></div></div><divclass="public anchor"id="var-freeze"><h3>freeze</h3><divclass="usage"><code>(freeze x)</code><code>(freeze x {:as opts, :keys [compressor encryptor password serializable-allowlist incl-metadata?], :or {compressor :auto, encryptor aes128-gcm-encryptor}})</code></div><divclass="doc"><preclass="plaintext">Serializes arg (any Clojure data type) to a byte array.
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
frequently made use of Nippy's Serializable support via
See that function's docstring for more info.</pre></div></div><divclass="public anchor"id="var-IFreezable1"><h3>IFreezable1</h3><h4class="type">protocol</h4><divclass="usage"></div><divclass="doc"><preclass="plaintext"></pre></div><divclass="members"><h4>members</h4><divclass="inner"><divclass="public anchor"id="var--freeze-without-meta.21"><h3>-freeze-without-meta!</h3><divclass="usage"><code>(-freeze-without-meta! x data-output)</code></div><divclass="doc"><preclass="plaintext"></pre></div></div></div></div></div><divclass="public anchor"id="var-IFreezable2"><h3>IFreezable2</h3><h4class="type">protocol</h4><divclass="usage"></div><divclass="doc"><preclass="plaintext"></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! x 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.
Ref. <ahref="https://github.com/mpenet/nippy-lz4">https://github.com/mpenet/nippy-lz4</a></pre></div></div><divclass="public anchor"id="var-lz4hc-compressor"><h3>lz4hc-compressor</h3><divclass="usage"></div><divclass="doc"><preclass="plaintext">Like `lz4-compressor` but trades some write speed for ratio.
environments.</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.
For use by tooling and advanced users.
**HIGHLY EXPERIMENTAL!**
Subject to breaking change without notice.
Currently completely untested, may contain bugs.
Intended for use only by early adopters to give design feedback.
; 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
{:nippy/unthawable {:class-name <> :content <quarantined-ba>}}, reads and
returns the object WITHOUT regard for `*thaw-serializable-allowlist*`.
**MAY BE UNSAFE!** Don't call this unless you absolutely trust the payload
to not contain any malicious code.
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 org.iq80.snappy.Snappy compressor:
A good general-purpose compressor.</pre></div></div><divclass="public anchor"id="var-stress-data"><h3>stress-data</h3><divclass="usage"></div><divclass="doc"><preclass="plaintext">Reference data used for tests & benchmarks
</pre></div></div><divclass="public anchor"id="var-stress-data-benchable"><h3>stress-data-benchable</h3><divclass="usage"></div><divclass="doc"><preclass="plaintext">Reference data with stuff removed that breaks reader or other utils we'll
be benching with.</pre></div></div><divclass="public anchor"id="var-stress-data-comparable"><h3>stress-data-comparable</h3><divclass="usage"></div><divclass="doc"><preclass="plaintext">Reference data with stuff removed that breaks roundtrip equality.
</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></div></body></html>