You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by "Kim van der Riet (JIRA)" <ji...@apache.org> on 2014/01/16 22:03:20 UTC

[jira] [Resolved] (QPID-5487) [linearstore] Replace use of /dev/urandom with c random generator calls

     [ https://issues.apache.org/jira/browse/QPID-5487?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kim van der Riet resolved QPID-5487.
------------------------------------

    Resolution: Fixed

Now uses 3 calls to rand() as follows:
{code}
((uint64_t)::rand() << 33) | ((uint64_t)::rand() << 2) | (::rand() & 0x3)
{code}
with the shift values and mask being calculated from the value of {{RAND_MAX}} (0x7fffffff, 31 bits).

> [linearstore] Replace use of /dev/urandom with c random generator calls
> -----------------------------------------------------------------------
>
>                 Key: QPID-5487
>                 URL: https://issues.apache.org/jira/browse/QPID-5487
>             Project: Qpid
>          Issue Type: Bug
>          Components: C++ Broker
>            Reporter: Kim van der Riet
>            Assignee: Kim van der Riet
>            Priority: Minor
>
> The use of /dev/urandom for random numbers is considered unfriendly to other systems on a machine that might depend upon this source.
> The current use-case is for Journal serial numbers; the randomness of the C rand() call should be good enough, but it requires a 64-bit number. Construct this using several smaller numbers from rand() or random()



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org