algorand / go-algorand-sdk

Algorand Golang SDK

Home Page:https://pkg.go.dev/github.com/algorand/go-algorand-sdk/v2

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add canonical check

mxmauro opened this issue · comments

Hi, DecodeAddress returns the same account for the following addresses:

PRICEP3G2F5L6ZG5WTJIAKEQW4OJJ3FM4XVFQDZI7M2VBTFVUHTTR2AU2U (this one is the correct)
PRICEP3G2F5L6ZG5WTJIAKEQW4OJJ3FM4XVFQDZI7M2VBTFVUHTTR2AU2V
PRICEP3G2F5L6ZG5WTJIAKEQW4OJJ3FM4XVFQDZI7M2VBTFVUHTTR2AU2W
PRICEP3G2F5L6ZG5WTJIAKEQW4OJJ3FM4XVFQDZI7M2VBTFVUHTTR2AU2X

This issue was addressed in node's code but wondering if checking the least significant bits of the 3rd byte of the checksum to be 01 is enough as a faster approach.

Regards,
Mauro.