encodeAddress static method
String
encodeAddress(
{ - required List<int> hash,
- required int workChain,
- bool bounceable = true,
- bool testOnly = false,
- bool urlSafe = false,
- bool noPadding = false,
})
Implementation
static String encodeAddress({
required List<int> hash,
required int workChain,
bool bounceable = true,
bool testOnly = false,
bool urlSafe = false,
bool noPadding = false,
}) {
hash = validateAddressHash(hash);
int tag =
bounceable
? FriendlyAddressFlags.bounceable.flag
: FriendlyAddressFlags.nonBounceable.flag;
if (testOnly) {
tag |= FriendlyAddressFlags.test.flag;
}
final List<int> addr = List<int>.unmodifiable([
tag,
workChain & BinaryOps.mask8,
...hash,
]);
final addrBytes = [...addr, ...Crc16.quickIntDigest(addr)];
return B64Encoder.encode(addrBytes, urlSafe: urlSafe, noPadding: noPadding);
}