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
- Host: GitHub
- URL: https://github.com/nuid/hex
- Owner: NuID
- License: apache-2.0
- Created: 2019-04-06T21:53:58.000Z (almost 7 years ago)
- Default Branch: main
- Last Pushed: 2023-10-27T13:31:59.000Z (over 2 years ago)
- Last Synced: 2025-03-13T09:44:34.372Z (11 months ago)
- Topics: clj, cljc, cljs, clojure, clojurescript, hex, hexadecimal
- Language: Clojure
- Homepage:
- Size: 95.7 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE-APACHE.md
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