https://github.com/biojulia/codecs.jl
Common data encoding algorithms
https://github.com/biojulia/codecs.jl
Last synced: about 1 year ago
JSON representation
Common data encoding algorithms
- Host: GitHub
- URL: https://github.com/biojulia/codecs.jl
- Owner: BioJulia
- License: other
- Created: 2013-01-20T03:24:24.000Z (over 13 years ago)
- Default Branch: master
- Last Pushed: 2020-01-25T18:00:46.000Z (over 6 years ago)
- Last Synced: 2025-04-06T03:31:44.602Z (about 1 year ago)
- Language: Julia
- Size: 45.9 KB
- Stars: 11
- Watchers: 10
- Forks: 14
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
OSX/Linux: [](https://travis-ci.org/dcjones/Codecs.jl)
pkg.julialang.org: [](http://pkg.julialang.org/?pkg=Codecs)
pkg.julialang.org: [](http://pkg.julialang.org/?pkg=Codecs)
pkg.julialang.org: [](http://pkg.julialang.org/?pkg=Codecs)
Windows: [](https://ci.appveyor.com/project/randyzwitch/codecs-jl/branch/master)
# Codecs
Basic data encoding and decoding protocols.
Currently implemented protocols: Base64, Zlib, Binary Coded Decimal.
## Synopsis
```julia
using Codecs
data = "Hello World!"
encoded = encode(Base64, encode(Zlib, data))
println(bytestring(encoded))
```
Output:
```
eNrzSM3JyVcIzy/KSVEEABxJBD4=
```
(Wow, that's inefficient.)
```julia
decoded = decode(Zlib, decode(Base64, encoded))
println(bytestring(decoded))
```
Output:
```
Hello World!
```
BCD is for encoding integers:
```julia
i = 2013
encoded = encode(BCD, i)
println(encoded)
encoded = encode(BCD, i, true) # big endian digit order
println(encoded)
```
Output:
```
[0x31,0x02]
[0x20,0x13]
```