SecureKey.random constructor

SecureKey.random(
  1. Sodium sodium,
  2. int length
)

Allocates new memory for a SecureKey and fills it with length bytes of random data.

Convenience factory constructor that redirects to Sodium.secureRandom and calls it with length on sodium.

Implementation

factory SecureKey.random(Sodium sodium, int length) =>
    sodium.secureRandom(length);