public static byte[] DecodeChecked(string input)
{
var tmp = Decode(input);
if (tmp.Length < 4)
throw new AddressFormatException("Input too short");
var checksum = new byte[4];
Array.Copy(tmp, tmp.Length - 4, checksum, 0, 4);
var bytes = new byte[tmp.Length - 4];
Array.Copy(tmp, 0, bytes, 0, tmp.Length - 4);
tmp = Utils.DoubleDigest(bytes);
var hash = new byte[4];
Array.Copy(tmp, 0, hash, 0, 4);
if (!hash.SequenceEqual(checksum))
throw new AddressFormatException("Checksum does not validate");
return bytes;
}