Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Nulls in scalar parameters



I'm working on a zsh/random module and I'm creating a builtin that returns a user-specified number of random bytes and either prints it or returns it in a parameter.  There exists a small possibility of embedded nulls in the output, and I'm not sure how to handle setting such a value in a parameter.

One solution is to make it return a hex string, but I'm not sure of the utility of such a result.

Metafy looks like it would handle the null problem, but I'm not sure what else it does nor how that would play out if printed to a file.

P.S. to be clear, this module would return random data drawn from the kernel's entropy pool, rather than a predictable pseudo-random generator like rand or erand48





Messages sorted by: Reverse Date, Date, Thread, Author