Skip to content

Latest commit

 

History

History
31 lines (20 loc) · 933 Bytes

README.md

File metadata and controls

31 lines (20 loc) · 933 Bytes

nuid.hex

Cross-platform hex {en,de}coding.

Requirements

jvm, node + npm, clj, shadow-cljs

Clojure and ClojureScript

tools.deps:

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

usage:

$ clj # or shadow-cljs node-repl
=> (require '[nuid.hex :as hex])
=> (def h (hex/encode "🐴"))    ;; defaults to reading input as utf8
=> h                            ;; => "f09f90b4"
=> (hex/decode h)               ;; => array-like: [240 159 144 180] (endianness may vary)
=> (hex/str h)                  ;; => "🐴"
=> (hex/str h :charset/utf16le) ;; => "鿰뒐"

Licensing

Apache v2.0 or MIT