xxhash
1 Reference
xxhash32
xxh32?
make-xxh32
xxh32-reset!
xxh32-update!
xxh32-digest
8.12

xxhash🔗ℹ

Bogdan Popa <bogdan@defn.io>

This package provides a pure-Racket implementation of xxHash32.

1 Reference🔗ℹ

 (require file/xxhash32) package: xxhash-lib

procedure

(xxhash32 bs [seed])  (integer-in 0 4294967295)

  bs : bytes?
  seed : (integer-in 0 4294967295) = 0
Computes the XXH32 hash of bs with the given seed.

procedure

(xxh32? v)  boolean?

  v : any/c

procedure

(make-xxh32 [seed])  xxh32?

  seed : (integer-in 0 4294967295) = 0

procedure

(xxh32-reset! h [seed])  void?

  h : xxh32?
  seed : (integer-in 0 4294967295) = 0

procedure

(xxh32-update! h bs [start end])  void?

  h : xxh32?
  bs : bytes?
  start : exact-nonnegative-integer? = 0
  end : exact-nonnegative-integer? = (bytes-length bs)

procedure

(xxh32-digest h)  (integer-in 0 4294967295)

  h : xxh32?
The make-xxh32 procedure returns a hashing context that can be used to compute an XXH32 digest using constant memory.

Examples:
> (require file/xxhash32)
> (define ctx (make-xxh32))
> (xxh32-update! ctx #"hello")
> (xxh32-update! ctx #" world!")
> (xxh32-digest ctx)

1171971541