#seed #script #helper #shell #random

bin+lib seed_gen

用于在 shell 脚本中处理种子的一个小助手

3 个稳定版本

1.2.0 2024 年 8 月 21 日
1.1.0 2024 年 8 月 19 日
1.0.0 2024 年 8 月 13 日

3#seed

Download history 56/week @ 2024-08-07 216/week @ 2024-08-14

每月 272 次下载

自定义许可

7KB
114

seed_gen

一个小的辅助工具,可以在您需要在 bash 脚本中使用一个或多个种子时使用。

示例

如果您想使用 10 个随机种子调用某个东西,您可以这样做:

# bash example

for seed in $(seed_gen random 10);
do
  echo "$seed"
done
# fish example

for seed in (seed_gen r 10)
  echo "$seed"
end

用法

Usage: seed_gen <COMMAND>

Commands:
  single  Returns the provided seed. If seed is a string, it is hashed beforehand [aliases: s]
  random  Returns the specied amount of random seeds [aliases: r, rand]
  range   Returns numbers in a range
  full    Generates all values from u64::MIN to u64::MAX
  help    Print this message or the help of the given subcommand(s)

Options:
  -h, --help  Print help

子命令

单个

Returns the provided seed. If seed is a string, it is hashed beforehand

Usage: seed_gen single <SEED>

Arguments:
  <SEED>  The specified seed

Options:
  -h, --help  Print help

随机

Returns the specied amount of random seeds

Usage: seed_gen random [COUNT]

Arguments:
  [COUNT]  The amount of seeds to print

Options:
  -h, --help  Print help

范围

Returns numbers in a range

Usage: seed_gen range [OPTIONS] <MIN> <MAX>

Arguments:
  <MIN>  The lowest number to print
  <MAX>  The highest number to print

Options:
  -s, --step <STEP>  The step size between two numbers
  -h, --help         Print help

全部

Generates all values from u64::MIN to u64::MAX

Usage: seed_gen full

Options:
  -h, --help  Print help

依赖项

~1.4–2MB
~39K SLoC