README.md 885 Bytes
Newer Older
roshii's avatar
roshii committed
1 2 3 4 5 6 7 8
# BitConverter.jl

Converts base data types to an array of bytes, and an array of bytes to base
data types.
So far Integer only are implemented.

[![pipeline status](https://gitlab.com/braneproject/bitconverter.jl/badges/master/pipeline.svg)](https://gitlab.com/braneproject/bitconverter.jl/commits/master)  [![coverage report](https://gitlab.com/braneproject/bitconverter.jl/badges/master/coverage.svg)](https://gitlab.com/braneproject/bitconverter.jl/commits/master)

roshii's avatar
roshii committed
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
## Examples

```julia
julia> bytes(big(2)^32)
5-element Array{UInt8,1}:
 0x01
 0x00
 0x00
 0x00
 0x00
```

```julia
julia> to_big(rand(UInt8, 8))
15240817377628901573

julia> to_int(rand(UInt8, 2))
48868

julia> to_int(rand(UInt8, 8))
-3411029373876830527
```

roshii's avatar
roshii committed
32 33
## Documentation

roshii's avatar
roshii committed
34
https://braneproject.gitlab.io/BitConverter.jl
roshii's avatar
roshii committed
35 36 37 38

## Buy me a cup of coffee

[Donate Bitcoin](bitcoin:34nvxratCQcQgtbwxMJfkmmxwrxtShTn67)