encodeValue method

  1. @override
Uint8List encodeValue(
  1. PrincipalId x
)
override

Encode the value. This needs to be public because it is used by encodeValue() from different types. @internal

Implementation

@override
Uint8List encodeValue(PrincipalId x) {
  final hex = x.toHex();
  final buf = hex.toU8a();
  final len = lebEncode(buf.length);
  return u8aConcat([
    Uint8List.fromList([1]),
    len,
    buf
  ]);
}