Cross-platform byte (de)serialization and conversion.
jvm
, node + npm
, clj
, shadow-cljs
{nuid/bytes {:git/url "https://github.com/nuid/bytes" :sha "..."}}
$ clj # or shadow-cljs node-repl
=> (require '[nuid.bytes :as bytes])
=> (def b (bytes/from "🐴")) ;; defaults to utf8
=> (bytes/str b) ;; => "🐴"
=> (bytes/str b :charset/utf16le) ;; => "鿰뒐"
=> (def b2 (bytes/from "🐴" :charset/utf16le))
=> (bytes/str b2 :charset/utf16le) ;; => "🐴"
Apache v2.0 or MIT