
Utilities for working with byte arrays in Clojure & Clojurescript
Using Leiningen / Clojars:
Baracus provides various utilities for working with byte arrays in Clojure & Clojurescript. This documentation is a work in progress.
This project works with byte-array data, which is often abbreviated
ba in code. B.A. Baracus
was a character on the 1980s TV series
The A-Team.
In Clojure, Baracus uses Java's primitive byte array. In ClojureScript,
Baracus uses the js/Int8Array data type. Note that bytes are signed
in both cases, following Java's implementation.
All public vars and functions are in the deercreeklabs.baracus namespace.
Any other namespaces should be considered private implementation details
that may change.
(byte-array? arg)
Tests if the argument is a byte array. For Clojure, this means a
Java primitive byte array. For ClojureScript, this means an instance
of the js/Int8Array data type.
arg: The argument to be testedtrue if the argument is a byte array, false otherwise
(require '[deercreeklabs.baracus :as ba])
(def my-ba (ba/byte-array 10))
(ba/byte-array? my-ba)
;; true
(ba/byte-array? "not a byte-array")
;; false
Distributed under the Apache Software License, Version 2.0 http://www.apache.org/licenses/LICENSE-2.0.txt
Copyright (c) 2017-2019 Deer Creek Labs, LLC
Can you improve this documentation?Edit on GitHub
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |