Можно ли получить исходный код dbms_random.random? - PullRequest
0 голосов
/ 29 апреля 2020

Можно ли получить исходный код dbms_random.random? Или хотя бы узнать, как это делается? Например,

, один из способов сделать это -

  randomValue = RandSeed * $08088405 + 1
  RandSeed = randomValue 

, но как это сделал dbms_random.value?

Ответы [ 2 ]

2 голосов
/ 29 апреля 2020

Источник pl sql доступен в базе данных Oracle.

Прочитать спецификации пакета -

------------
    --  OVERVIEW
    --
    --  This package should be installed as SYS.  It generates a sequence of
    --  random 38-digit Oracle numbers.  The expected length of the sequence
    --  is about power(10,28), which is hopefully long enough.
    --
    --------
    --  USAGE
    --
    --  This is a random number generator.  Do not use for cryptography.
    --  For more options the cryptographic toolkit should be used.
    --
    --  By default, the package is initialized with the current user
    --  name, current time down to the second, and the current session.
    --
    --  If this package is seeded twice with the same seed, then accessed
    --  in the same way, it will produce the same results in both cases.
    --
    --------

enter image description here

2 голосов
/ 29 апреля 2020

Да; поиск dbmsrand.sql. На моем Oracle 11g XE он находится в

C:\oraclexe\app\oracle\product\11.2.0\server\rdbms\admin\dbmsrand.sql
...