asimov.util

bytes-to-buffer

(bytes-to-buffer bs)
Makes debugging byte fiddling code easier by conveniently generating bytebuffers.

Expects:
 bs:string A textual representation of bytes, written in hex grouped by 2 digits.


Returns a bytebuffer with the encoded bytes.

cycles

(cycles graph)
Detects and returns cycles in dependency graphs.
Code borrowed adapted from Cris Grangers https://www.refheap.com/20384

Expects:
 graph:map The graph encoded as a map where each key is a node
           and each value is a set of children.

Returns a set of vectors that contain the cyclic paths of nodes.

parse-addr

(parse-addr addr)
Makes working with urls easier by representing them as clojure maps.
Inverse function of `serialize-addr`.

Expects:
 addr:string Of the form  "http://<host>:<port>";

Returns a map with :host and :port.

serialize-addr

(serialize-addr addr)
Makes working with urls easier by representing them as clojure maps.
Inverse function of `parse-addr`.

Expects:
 addr:map Contains :host and :port entries.

Returns a string of the form  "http://<host>:<port>";