Skip to content

Commit 4283992

Browse files
author
idk
committed
Improve the validator
1 parent ae5c4f8 commit 4283992

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

transcoders.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -283,9 +283,9 @@ func garlic32BtS(b []byte) (string, error) {
283283
func garlic32Validate(b []byte) error {
284284
// an i2p base64 for an Encrypted Leaseset v2 will be at least 35 bytes
285285
// long
286-
if len(b) > 35 {
287-
// other than that, they will be at least 32 bytes
288-
if len(b) < 32 {
286+
if len(b) < 35 {
287+
// other than that, they will be exactly 32 bytes
288+
if len(b) != 32 {
289289
return fmt.Errorf("failed to validate garlic addr: %s not an i2p base32 address. len: %d\n", b, len(b))
290290
}
291291
}

0 commit comments

Comments
 (0)