The Python built in method int.from_bytes() returns the integer represented by the given array of bytes. I wanted know the Clojure equivalent of such method or similar methods in Clojure.
1 Answer
You could use java's java's BigInteger directly:
(BigInteger. (byte-array [1 2 3]))
=> 66051
Since clojure natively supports big numbers, you could use it seamlessly with clojure's arithmetics:
(def b (BigInteger. (byte-array [1 2 3])))
(+ b 23)
=> 66074N