My Oracle Support Banner

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

Last updated on NOVEMBER 22, 2019

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

To view full details, sign in with your My Oracle Support account.

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


In this Document
Symptoms
Cause
Solution


My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.