Adding a very simple version of hs (hex string).

master
Karchnu 2020-11-26 16:06:58 +01:00
parent 4aebd53ef5
commit 0408d94fdc
3 changed files with 16 additions and 0 deletions

View File

@ -17,3 +17,11 @@ cq ".people.alice.age" < file.cbor
json-to-cbor < file.json > file.cbor json-to-cbor < file.json > file.cbor
``` ```
# hs usage
`hs` stands for `hexstring`.
```sh
hs < file.cbor
```

View File

@ -12,6 +12,8 @@ targets:
main: src/cq.cr main: src/cq.cr
json-to-cbor: json-to-cbor:
main: src/json-to-cbor.cr main: src/json-to-cbor.cr
hs:
main: src/hs.cr
bm-json-vs-cbor: bm-json-vs-cbor:
main: tests/json-vs-cbor.cr main: tests/json-vs-cbor.cr

6
src/hs.cr Normal file
View File

@ -0,0 +1,6 @@
if ARGV.size >= 1
puts "usage: hs < file.cbor"
exit 0
end
puts STDIN.gets_to_end.to_slice.hexstring