Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nuid/bytes
Cross-platform byte (de)serialization and conversion
https://github.com/nuid/bytes
bytes clj cljc cljs clojure clojurescript
Last synced: 1 day ago
JSON representation
Cross-platform byte (de)serialization and conversion
- Host: GitHub
- URL: https://github.com/nuid/bytes
- Owner: NuID
- License: apache-2.0
- Created: 2019-04-06T21:45:09.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2023-10-27T13:32:21.000Z (about 1 year ago)
- Last Synced: 2024-10-13T14:08:46.087Z (about 1 month ago)
- Topics: bytes, clj, cljc, cljs, clojure, clojurescript
- Language: Clojure
- Homepage:
- Size: 102 KB
- Stars: 0
- Watchers: 3
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE-APACHE.md
Awesome Lists containing this project
README
# nuid.bytes
Cross-platform byte (de)serialization and conversion.
## 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/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