Liking cljdoc? Tell your friends :D

tupelo.iuid

Given a user-selected number of bits (currently [4..128]), creates a reversible mapping from integer index to a Unique ID (UID). Both the index and the UID are in the range of [0..N), where N = 2^num-bits.

Given a user-selected number of bits (currently [4..128]), creates a
reversible mapping from integer index to a Unique ID (UID). Both
the index and the UID are in the range of [0..N), where N = 2^num-bits. 
raw docstring

idx->uidclj

(idx->uid ctx ival)

Inputs: [ctx :- tsk/KeyMap ival :- s/Int] Returns: BigInteger

Given a context map and an index value [0..2^N), returns the corresponding UID value (Unique ID), also in [0..2^N). UID values are guaranteed to be unique for each index and pseudo-random within the interval [0..2^N). The context map specifies N as the value of the :num-bits key.

Inputs: [ctx :- tsk/KeyMap ival :- s/Int]
Returns: BigInteger

Given a context map and an index value [0..2^N), returns the corresponding
UID value (Unique ID), also in [0..2^N). UID values are guaranteed
to be unique for each index and pseudo-random within the interval [0..2^N).
The context map specifies N as the value of the `:num-bits` key. 
sourceraw docstring

new-ctxclj

(new-ctx opts)

Inputs: [opts :- tsk/KeyMap] Returns: tsk/KeyMap

Creates a new Indexed Unique ID (IUID) context map. Usage:

  (new-ctx <params-map>)

where <params-map> is of the form:

  {:num-bits     <long>  ; REQUIRED:  input/output integers in range [0..2^n) (min=4  max=128):
   :rand-seed    <long>  ; optional:  PRNG seed (default: randomized)
   :num-rounds   <long>  ; optional:  positive int (default: 7)
  } 
Inputs: [opts :- tsk/KeyMap]
Returns: tsk/KeyMap

Creates a new Indexed Unique ID (IUID) context map. Usage:

      (new-ctx <params-map>)

 where <params-map> is of the form:

      {:num-bits     <long>  ; REQUIRED:  input/output integers in range [0..2^n) (min=4  max=128):
       :rand-seed    <long>  ; optional:  PRNG seed (default: randomized)
       :num-rounds   <long>  ; optional:  positive int (default: 7)
      } 
sourceraw docstring

uid->idxclj

(uid->idx ctx uid)

Inputs: [ctx :- tsk/KeyMap uid :- s/Int] Returns: BigInteger

Given a context map and a UID value (Unique ID) in [0..2^N), returns the corresponding index value, also in [0..2^N). The context map specifies N as the value of the :num-bits key.

Inputs: [ctx :- tsk/KeyMap uid :- s/Int]
Returns: BigInteger

Given a context map and a UID value (Unique ID) in [0..2^N),
 returns the corresponding index value, also in [0..2^N).
The context map specifies N as the value of the `:num-bits` key.   
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close