sign static method

Uint8List sign(
  1. Uint8List message,
  2. SecretKey key
)

Returns 65 bytes: r (32) + s (32) + v (1, where v = recId + 27).

Implementation

static Uint8List sign(Uint8List message, SecretKey key) {
  final hash = messageHash(message);
  final sig = RecoverableEcdsaSig.sign(hash, key.bytes);
  final out = Uint8List(65);
  out.setRange(0, 64, sig.bytes);
  out[64] = sig.recId + 27;
  return out;
}