Skip to content

Latest commit

 

History

History
31 lines (20 loc) · 961 Bytes

README.md

File metadata and controls

31 lines (20 loc) · 961 Bytes

nuid.bytes

Cross-platform byte (de)serialization and conversion.

Requirements

jvm, node + npm, clj, shadow-cljs

Clojure and ClojureScript

tools.deps:

{nuid/bytes {:git/url "https://github.com/nuid/bytes" :sha "..."}}

usage:

$ 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)             ;; => "🐴"

Licensing

Apache v2.0 or MIT