Skip to content

Have SRANDMEMBER and RANDOMKEY accept a seed #870

@tobsn

Description

@tobsn

(Feature request)

SRANDMEMBER myset [count] [seed]

SRANDMEMBER myset
// return one random member
SRANDMEMBER myset 2
// return two random members
SRANDMEMBER myset 1 "723432"
// return one random member, randomness based on seed
// first attribute could be switched to seed if second attribute is string not int (count of members vs. "seed")

RANDOMKEY [seed]

RANDOMKEY
// return one random key
RANDOMKEY "723432"
// return one random key, randomness based on seed

The problem hit me today as I want to have a random set member but I want to have the same random set member based on a seed. In my example, the randomness should stay the same per IP.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions