8000 Support for V8 Javascript Engine's Math.Random()? · Issue #31 · altf4/untwister · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Support for V8 Javascript Engine's Math.Random()? #31
Open
@innsternet

Description

@innsternet

Awesome project by the way.

Would it be possible to support Javascript's Engine (V8) Math.Random() which is used by Chrome/Node.js?
(https://github.com/v8/v8-git-mirror/blob/master/src/math.js)
(http://v8.googlecode.com/svn-history/r8490/branches/bleeding_edge/src/v8.cc)

function MathRandom() {
  var r0 = (MathImul(18030, rngstate[0] & 0xFFFF) + (rngstate[0] >>> 16)) | 0;
  rngstate[0] = r0;
  var r1 = (MathImul(36969, rngstate[1] & 0xFFFF) + (rngstate[1] >>> 16)) | 0;
  rngstate[1] = r1;
  var x = ((r0 << 16) + (r1 & 0xFFFF)) | 0;
  // Division by 0x100000000 through multiplication by reciprocal.
  return (x < 0 ? (x + 0x100000000) : x) * 2.3283064365386962890625e-10;
}

For example making it possible to predict the upcoming values from Math.random() on Chrome/Web Applications running NodeJs.

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0