Liking cljdoc? Tell your friends :D

hasch.fast

Fast binary-encoded hashing with streaming digest. ~6-14x faster than hasch.core for most data types.

Key optimizations:

  1. Binary encoding for numbers (2000x faster than string conversion)
  2. Streaming digest - update MessageDigest directly, no intermediate byte arrays
  3. Single MessageDigest instance per hash operation
  4. Pre-allocated buffers for common sizes

IMPORTANT: This produces different hashes than hasch.core/uuid due to binary encoding. Use hasch.core for legacy compatibility or when you need string-based number representation.

Fast binary-encoded hashing with streaming digest.
~6-14x faster than hasch.core for most data types.

Key optimizations:
1. Binary encoding for numbers (2000x faster than string conversion)
2. Streaming digest - update MessageDigest directly, no intermediate byte arrays
3. Single MessageDigest instance per hash operation
4. Pre-allocated buffers for common sizes

IMPORTANT: This produces different hashes than hasch.core/uuid due to
binary encoding. Use hasch.core for legacy compatibility or when you
need string-based number representation.
raw docstring

*write-handlers*clj/s

source

b64-hashclj/s

(b64-hash val)

Base64 encoded hash string.

Base64 encoded hash string.
sourceraw docstring

edn-hashclj/s

(edn-hash val)
(edn-hash val md-create-fn)
(edn-hash val md-create-fn write-handlers)

Hash any EDN value using streaming binary encoding.

Options:

  • md-create-fn: Function to create MessageDigest (default: SHA-512)
  • write-handlers: incognito write-handlers map for record serialization

Returns byte array of hash.

Hash any EDN value using streaming binary encoding.

Options:
- md-create-fn: Function to create MessageDigest (default: SHA-512)
- write-handlers: incognito write-handlers map for record serialization

Returns byte array of hash.
sourceraw docstring

format-versionclj/s

source

hash->strclj/s

(hash->str bytes)

Convert hash bytes to hex string.

Convert hash bytes to hex string.
sourceraw docstring

magic-bigdecclj/s

source

magic-bigintclj/s

source

magic-booleanclj/s

source

magic-bytesclj/s

source

magic-charclj/s

source

magic-doubleclj/s

source

magic-instclj/s

source

magic-keywordclj/s

source

magic-longclj/s

source

magic-mapclj/s

source

magic-nilclj/s

source

magic-ratioclj/s

source

magic-recordclj/s

source

magic-seqclj/s

source

magic-setclj/s

source

magic-stringclj/s

source

magic-symbolclj/s

source

magic-uuidclj/s

source

magic-vectorclj/s

source

PStreamHashclj/sprotocol

Protocol for streaming hash updates. Instead of creating intermediate byte arrays, implementations update the MessageDigest directly.

Protocol for streaming hash updates. Instead of creating intermediate
byte arrays, implementations update the MessageDigest directly.

-update-digestclj/s

(-update-digest this md)
sourceraw docstring

sha256-message-digestclj/s

(sha256-message-digest)

Create a SHA-256 hasher.

Create a SHA-256 hasher.
sourceraw docstring

sha256-uuidclj/s

(sha256-uuid val)

SHA-256 based UUID (faster, still cryptographically secure).

SHA-256 based UUID (faster, still cryptographically secure).
sourceraw docstring

sha512-message-digestclj/s

(sha512-message-digest)

Create a SHA-512 hasher.

Create a SHA-512 hasher.
sourceraw docstring

squuidclj/s

(squuid)
(squuid base-uuid)

Sequential UUID with timestamp prefix. With no args, generates a random base UUID. With a UUID arg, uses that as base.

Sequential UUID with timestamp prefix.
With no args, generates a random base UUID. With a UUID arg, uses that as base.
sourceraw docstring

uuidclj/s

(uuid)
(uuid val)
(uuid val md-create-fn)

Generate UUID-5 from hash of value, or random UUID-4 with no arguments.

Uses binary encoding for ~10-100x faster hashing than hasch.core/uuid for data with many numbers.

Optionally accepts write-handlers for record serialization via incognito.

Generate UUID-5 from hash of value, or random UUID-4 with no arguments.

Uses binary encoding for ~10-100x faster hashing than hasch.core/uuid
for data with many numbers.

Optionally accepts write-handlers for record serialization via incognito.
sourceraw docstring

uuid4clj/s

(uuid4)

Generates a UUID version 4 (random).

Generates a UUID version 4 (random).
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close