diff options
author | rsiddharth <s@ricketyspace.net> | 2020-11-25 00:10:52 -0500 |
---|---|---|
committer | rsiddharth <s@ricketyspace.net> | 2020-11-25 00:10:52 -0500 |
commit | f17751d48f480bbaba999ca4357096128e125c6e (patch) | |
tree | 2558deaeedab49fa678cc9e1e4788ae4badaad5e /lib/blocks.go | |
parent | 4ff5d61d98a260858d15bb63727c7bfe13bfe987 (diff) |
lib: blocks: add BlocksEqual
Diffstat (limited to 'lib/blocks.go')
-rw-r--r-- | lib/blocks.go | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/blocks.go b/lib/blocks.go index d13b107..9436d3c 100644 --- a/lib/blocks.go +++ b/lib/blocks.go @@ -47,3 +47,16 @@ func TransposeBlocks(blocks [][]byte, keysize int) [][]byte { } return tblocks } + +func BlocksEqual(a, b []byte) bool { + if len(a) != len(b) { + return false + } + + for i := 0; i < len(a); i++ { + if a[i] != b[i] { + return false + } + } + return true +} |