summaryrefslogtreecommitdiffstats
path: root/lib/blocks.go
diff options
context:
space:
mode:
authorrsiddharth <s@ricketyspace.net>2020-11-25 00:10:52 -0500
committerrsiddharth <s@ricketyspace.net>2020-11-25 00:10:52 -0500
commitf17751d48f480bbaba999ca4357096128e125c6e (patch)
tree2558deaeedab49fa678cc9e1e4788ae4badaad5e /lib/blocks.go
parent4ff5d61d98a260858d15bb63727c7bfe13bfe987 (diff)
lib: blocks: add BlocksEqual
Diffstat (limited to 'lib/blocks.go')
-rw-r--r--lib/blocks.go13
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
+}