~hp/issues#10: 
Suggested source of entropy for random seed?

Moony is awesome! I've only just started using it to solve various midi filters. Thanks for creating it!

Since the os library isn't available for time(), do you have a suggested source of entropy to seed the random library with? Thanks! I've been working on this script: https://gist.github.com/ssj71/0e839f99e5163804ad005773827fc71b

Status
RESOLVED FIXED
Submitter
~hp
Assigned to
~hp
Submitted
1 year, 2 months ago
Updated
1 year, 26 days ago
Labels
moony

~hp 1 year, 2 months ago

On 26.10.22 20:55, ssj71 wrote:

Moony is awesome! I've only just started using it to solve various midi filters.

Glad you like it.

Since the |os| library isn't available for |time()|, do you have a suggested source of entropy to seed the random library with?

Oh, I cannot think of anything inside Moony that could provide entropy. There's definitely something missing here.

Some time functions (gettimeofday, clock_gettime) are RT-safe, that could be an option.

Maybe a dedicated function would even be better that would read from an RT-safe ringbuffer filled up from /dev/(u)random.

 local seed = Entropy()

~hp 1 year, 2 months ago*

That sounds great! I was considering just using one of the handles passed into the once() function but that would be much better!

Register here or Log in to comment, or comment via email.