logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

random-string - (encryption)

Description

random-string obtains a random string of length <string length>. If "length" clause is omitted, the length is 20 by default. If "number" clause is used, then the resulting string is composed of digits only ("0" through "9"). If "binary" clause is used, then the resulting string is binary, i.e. each byte can have an unsigned value of 0-255. By default, if neither "number" or "binary" is used, the resulting string is alphanumeric, i.e. digits ("0" through "9") and alphabet letters ("a"-"z" and "A"-"Z") are used only. Random generator is based on the Linux random() generator seeded by local process properties such as its PID and time. A single process is seeded once, and thus any number of requests served by the same process will use a subset of the process' random sequence. Due to joint entropy, each result given to any request is random, not just within a single request, but among any number of different requests.

Examples

Get a 100-digit long random value (as an alphanumeric string): random-string to str length 100 print-format "%s\n", str Get a random number of length 10 in string representation: random-string to str length 10 number print-format "%s\n", str Get a random binary value that is 8 bytes in length - this value may contain null bytes (i.e. it will contain bytes with values ranging from 0 to 255): random-string to str length 8 binary

Name

random-string - (encryption)

Purpose

Obtain a random string.

See Also

Encryption decrypt-dataderive-keyencrypt-datahash-stringhmac-stringrandom-cryptorandom-string See all documentation $DATE $VERSION GOLF(2gg)

Syntax

random-string to <random string> \ [ length <string length> ] \ [ number | binary ]

See Also