import { fn } from "https://deno.land/x/ddc_vim@v4.0.2/deps.ts";
const { srand } = fn;
Initialize seed used by rand()
:
- If {expr} is not given, seed values are initialized by reading from /dev/urandom, if possible, or using time(NULL) a.k.a. epoch time otherwise; this only has second accuracy.
- If {expr} is given it must be a Number. It is used to initialize the seed values. This is useful for testing or when a predictable sequence is intended.
Examples:
:let seed = srand()
:let seed = srand(userinput)
:echo rand(seed)
Parameters
denops: Denops