secure_random 1.0.1 copy "secure_random: ^1.0.1" to clipboard
secure_random: ^1.0.1 copied to clipboard

A secure random generator to generate cryptographically secure random string.

example/main.dart

import 'package:secure_random/secure_random.dart';

void main() {
  var secureRandom = SecureRandom();

  print(secureRandom.nextString(length: 10)); // e.g. 9FCjKnM4OW

  print(secureRandom.nextString(
      length: 10, charset: '0123456789')); // e.g. d8b08cbea6

  print(secureRandom.nextString(
      length: 10, charset: 'abcdefghijklmnopqrstuvwxyz')); // e.g. iqixgbjgfx

  print(secureRandom.nextString(
      length: 10, charset: '0123456789abcdef')); // e.g. d8b08cbea6

  print(secureRandom.nextString(
      length: 10,
      charset:
          'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ')); // e.g. EUfpfiFEfv

  print(secureRandom.nextString(
      length: 10,
      charset:
          'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789~!@#\$%^&*()_+`')); // e.g. sUkf1(xM3Z
}
8
likes
40
pub points
64%
popularity

Publisher

unverified uploader

A secure random generator to generate cryptographically secure random string.

Repository (GitHub)
View/report issues

License

MIT (LICENSE)

More

Packages that depend on secure_random