Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

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

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