FLUTTER ECOSYSTEM

damondouglas/random_string.dart

랜덤한 ASCII 문자열을 생성합니다.

random_string.dart 프로젝트 이미지
Stars
24
Forks
9
최근 푸시(UTC)
2021. 7. 16.
프로젝트 상태
활성
Damon GitHub avatar
GITHUB User

Damon ↗

Software is magic when it enables the dreams of others.

Google, Inc.
언어Dart

이 저장소가 배포한 패키지

사용 중인 의존성

의존성 목록 1 개
  • test개발 의존성^1.17.9

원본 README

아래는 영문 원문 스냅샷입니다. 최신 내용은 GitHub에서 확인하세요.

README 펼치기 / 접기

random_string

Simple library for generating random ascii strings.

Design goals and limitations

While this package provides randomBetween for convenience, as the name implies, the design goal of this package is for random generation of ascii strings, particularly for testing and not for cryptographic purposes.
With that stated, consider an alternative means of random number generation if your needs fall outside these goals and limitations.

Usage

A simple usage example:

import 'package:random_string/random_string.dart';
import 'dart:math' show Random;

main() {
  print(randomBetween(10, 20)); // some integer between 10 and 20 where 0 <= min <= max <= 999999999999999
  print(randomNumeric(4)); // sequence of 4 random numbers i.e. 3259
  print(randomString(10)); // random sequence of 10 characters i.e. e~f93(4l-
  print(randomAlpha(5)); // random sequence of 5 alpha characters i.e. aRztC
  print(randomAlphaNumeric(10)); // random sequence of 10 alpha numeric i.e. aRztC1y32B

  var r = Random.secure();
  print(randomBetween(10, 20, provider: CoreRandomProvider.from(r))); // You can use a provider from Random.
  print(randomBetween(10, 20, provider: _Provider())); // Or you can implement your own.
}

class _Provider with AbstractRandomProvider {
  _Provider();
  double nextDouble() => 0.5;
}

Features and bugs

Please file feature requests and bugs at the issue tracker.