Skip to content

BioJulia/Codecs.jl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

53 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OSX/Linux: Build Status
pkg.julialang.org: Codecs
pkg.julialang.org: Codecs
pkg.julialang.org: Codecs
Windows: Build status

Codecs

Basic data encoding and decoding protocols.

Currently implemented protocols: Base64, Zlib, Binary Coded Decimal.

Synopsis

using Codecs

data = "Hello World!"
encoded = encode(Base64, encode(Zlib, data))
println(bytestring(encoded))

Output:

eNrzSM3JyVcIzy/KSVEEABxJBD4=

(Wow, that's inefficient.)

decoded = decode(Zlib, decode(Base64, encoded))
println(bytestring(decoded))

Output:

Hello World!

BCD is for encoding integers:

i = 2013
encoded = encode(BCD, i)
println(encoded)
encoded = encode(BCD, i, true)  # big endian digit order
println(encoded)

Output:

[0x31,0x02]
[0x20,0x13]