An open API service indexing awesome lists of open source software.

https://github.com/nuid/hex

Cross-platform hex {en,de}coding
https://github.com/nuid/hex

clj cljc cljs clojure clojurescript hex hexadecimal

Last synced: 29 days ago
JSON representation

Cross-platform hex {en,de}coding

Awesome Lists containing this project

README

          

# nuid.hex

Cross-platform hex {en,de}coding.

## Requirements

[`jvm`](https://www.java.com/en/download/), [`node + npm`](https://nodejs.org/en/download/), [`clj`](https://clojure.org/guides/getting_started), [`shadow-cljs`](https://shadow-cljs.github.io/docs/UsersGuide.html#_installation)

## 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