yakir12 / COBS.jl
Showing 1 of 2 files from the diff.
Other files ignored by Codecov
test/runtests.jl has changed.

@@ -1,6 +1,6 @@
Loading
1 1
module COBS
2 2
3 -
export encode
3 +
export encode, decode
4 4
5 5
function _doblock(xs)
6 6
    n = length(xs)
@@ -40,7 +40,7 @@
Loading
40 40
"""
41 41
    encode(payload)
42 42
43 -
Return theeEncoded `payload`.
43 +
Return the encoded `payload`.
44 44
"""
45 45
function encode(payload)
46 46
    blocks = Vector{Vector{UInt8}}()
@@ -51,4 +51,30 @@
Loading
51 51
    vcat(blocks..., 0x00)
52 52
end
53 53
54 +
function _f!(y, msg, i1, i2)
55 +
    for i in i1 + 1:i2 - 1
56 +
        y[i - 1] = msg[i]
57 +
    end
58 +
    return i2, i2 + msg[i2]
59 +
end
60 +
61 +
"""
62 +
    decode(payload)
63 +
64 +
Return the decoded `payload`.
65 +
"""
66 +
function decode(msg)
67 +
    y = Vector{UInt8}(undef, length(msg) - 2)
68 +
    i1 = 0x01
69 +
    i2 = i1 + msg[i1]
70 +
    i1, i2 = _f!(y, msg, i1, i2)
71 +
    while i1 < i2
72 +
        y[i1 - 1] = 0
73 +
        i1, i2 = _f!(y, msg, i1, i2)
74 +
    end
75 +
    return y
76 +
end
77 +
78 +
79 +
54 80
end # module
Files Coverage
src/COBS.jl 100.00%
Project Totals (1 files) 100.00%

No yaml found.

Create your codecov.yml to customize your Codecov experience

Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading