From 8eb7b44e5b050fa8a39903f8f5049de45cbb2319 Mon Sep 17 00:00:00 2001 From: Iggy Lake Date: Mon, 1 Jul 2019 14:08:40 +0200 Subject: [PATCH] get master w/ the new sumId --- sum.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sum.go b/sum.go index 73642fa..24f1285 100644 --- a/sum.go +++ b/sum.go @@ -80,11 +80,11 @@ func sumBlake2b(data []byte, size int) ([]byte, error) { } func sumID(data []byte, length int) ([]byte, error) { - // if length >= 0 && length != len(data) { - // return nil, fmt.Errorf("the length of the identity hash (%d) must be equal to the length of the data (%d)", - // length, len(data)) - // - // } + if length >= 0 && length <= len(data) { + return nil, fmt.Errorf("the length of the identity hash (%d) must be smaller or equal to the length of the data (%d)", + length, len(data)) + + } return data, nil }