Clib.srand() with seed number generated by getTime() method can not make Clib.rand() generate random number. (Doc ID 1990190.1)

Last updated on MARCH 02, 2017

Applies to:

Siebel Financial Services CRM - Version 8.1.1.14 [IP2014] to 8.1.1.14 [IP2014] [Release V8]
Information in this document applies to any platform.

Symptoms

Statement of Issue:
-----------------------
Customer wants to generate different password by using Clib.rand() method.
- When Clib.srand() uses timestamp as seed number, Clib.rand() always generates same number. This is unexpected behavior.
- When Clib.srand() uses the seed number generated by Operating System(OS), Clib.rand() generates different number. This is expected behavior.
Customer's requirement is to explicitly use seed number in Clib.srand().

Environment:
----------------
8.1.1.14 [IP2014]

Steps:
--------
The following Clib.srand() is invoked then Clib.rand() always generates same number.

  var today = new Date;
  var vtimestamp = today.getTime();
  Clib.srand(vtimestamp)

Error:
------
No error message.
Always same random number is generated.

Expected Behavior:
-----------------------
Clib.rand() mehoud should generated different number every time it is invoked.

Actual Behavior:
-------------------
Clib.srand() method generates same number when Clib.srand() uses timestamp as seed number.
If Clib.srand() uses the seed number generated by OS, Clib.rand() works fine.

Business Impact:
--------------------
Customer's initial password generation is not working.
Same passwords are generated to every users.

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms