repl.txt (9063B)
1 2 {{alias}}( a, b[, options] ) 3 Returns a readable stream for generating pseudorandom numbers drawn from an 4 arcsine distribution. 5 6 In addition to standard readable stream events, the returned stream emits a 7 'state' event after internally generating `siter` pseudorandom numbers, 8 which is useful when wanting to deterministically capture a stream's 9 underlying PRNG state. 10 11 Parameters 12 ---------- 13 a: number 14 Minimum support. 15 16 b: number 17 Maximum support. 18 19 options: Object (optional) 20 Options. 21 22 options.objectMode: boolean (optional) 23 Specifies whether a stream should operate in "objectMode". Default: 24 false. 25 26 options.encoding: string|null (optional) 27 Specifies how Buffer objects should be decoded to strings. Default: 28 null. 29 30 options.highWaterMark: integer (optional) 31 Specifies the maximum number of bytes to store in an internal buffer 32 before ceasing to generate additional pseudorandom numbers. 33 34 options.sep: string (optional) 35 Separator used to join streamed data. This option is only applicable 36 when a stream is not in "objectMode". Default: '\n'. 37 38 options.iter: integer (optional) 39 Number of iterations. 40 41 options.prng: Function (optional) 42 Pseudorandom number generator (PRNG) for generating uniformly 43 distributed pseudorandom numbers on the interval `[0,1)`. If provided, 44 the `state` and `seed` options are ignored. In order to seed the 45 returned iterator, one must seed the provided `prng` (assuming the 46 provided `prng` is seedable). 47 48 options.seed: integer|ArrayLikeObject<integer> (optional) 49 Pseudorandom number generator seed. The seed may be either a positive 50 unsigned 32-bit integer or, for arbitrary length seeds, an array-like 51 object containing unsigned 32-bit integers. 52 53 options.state: Uint32Array (optional) 54 Pseudorandom number generator state. If provided, the `seed` option is 55 ignored. 56 57 options.copy: boolean (optional) 58 Boolean indicating whether to copy a provided pseudorandom number 59 generator state. Setting this option to `false` allows sharing state 60 between two or more pseudorandom number generators. Setting this option 61 to `true` ensures that a returned iterator has exclusive control over 62 its internal state. Default: true. 63 64 options.siter: integer (optional) 65 Number of iterations after which to emit the PRNG state. Default: 1e308. 66 67 Returns 68 ------- 69 stream: ReadableStream 70 Readable stream. 71 72 stream.PRNG: Function 73 Underlying pseudorandom number generator. 74 75 stream.seed: Uint32Array|null 76 Pseudorandom number generator seed. 77 78 stream.seedLength: integer|null 79 Length of generator seed. 80 81 stream.state: Uint32Array|null 82 Generator state. 83 84 stream.stateLength: integer|null 85 Length of generator state. 86 87 stream.byteLength: integer|null 88 Size (in bytes) of generator state. 89 90 Examples 91 -------- 92 > function fcn( chunk ) { console.log( chunk.toString() ); }; 93 > var opts = { 'iter': 10 }; 94 > var s = {{alias}}( 2.0, 5.0, opts ); 95 > var o = {{alias:@stdlib/streams/node/inspect-sink}}( fcn ); 96 > s.pipe( o ); 97 98 99 {{alias}}.factory( [a, b, ][options] ) 100 Returns a function for creating readable streams which generate pseudorandom 101 numbers drawn from an arcsine distribution. 102 103 If provided distribution parameters, the returned function returns readable 104 streams which generate pseudorandom numbers drawn from the specified 105 distribution. 106 107 If not provided distribution parameters, the returned function requires that 108 distribution parameters be provided at each invocation. 109 110 Parameters 111 ---------- 112 a: number (optional) 113 Minimum support. 114 115 b: number (optional) 116 Maximum support. 117 118 options: Object (optional) 119 Options. 120 121 options.objectMode: boolean (optional) 122 Specifies whether a stream should operate in "objectMode". Default: 123 false. 124 125 options.encoding: string|null (optional) 126 Specifies how Buffer objects should be decoded to strings. Default: 127 null. 128 129 options.highWaterMark: integer (optional) 130 Specifies the maximum number of bytes to store in an internal buffer 131 before ceasing to generate additional pseudorandom numbers. 132 133 options.sep: string (optional) 134 Separator used to join streamed data. This option is only applicable 135 when a stream is not in "objectMode". Default: '\n'. 136 137 options.iter: integer (optional) 138 Number of iterations. 139 140 options.prng: Function (optional) 141 Pseudorandom number generator (PRNG) for generating uniformly 142 distributed pseudorandom numbers on the interval `[0,1)`. If provided, 143 the `state` and `seed` options are ignored. In order to seed the 144 returned iterator, one must seed the provided `prng` (assuming the 145 provided `prng` is seedable). 146 147 options.seed: integer|ArrayLikeObject<integer> (optional) 148 Pseudorandom number generator seed. The seed may be either a positive 149 unsigned 32-bit integer or, for arbitrary length seeds, an array-like 150 object containing unsigned 32-bit integers. 151 152 options.state: Uint32Array (optional) 153 Pseudorandom number generator state. If provided, the `seed` option is 154 ignored. 155 156 options.copy: boolean (optional) 157 Boolean indicating whether to copy a provided pseudorandom number 158 generator state. Setting this option to `false` allows sharing state 159 between two or more pseudorandom number generators. Setting this option 160 to `true` ensures that a returned iterator has exclusive control over 161 its internal state. Default: true. 162 163 options.siter: integer (optional) 164 Number of iterations after which to emit the PRNG state. Default: 1e308. 165 166 Returns 167 ------- 168 fcn: Function 169 Function for creating readable streams. 170 171 Examples 172 -------- 173 > var opts = { 'objectMode': true, 'highWaterMark': 64 }; 174 > var createStream = {{alias}}.factory( opts ); 175 176 177 {{alias}}.objectMode( a, b[, options] ) 178 Returns an "objectMode" readable stream for generating pseudorandom numbers 179 drawn from an arcsine distribution. 180 181 Parameters 182 ---------- 183 a: number 184 Minimum support. 185 186 b: number 187 Maximum support. 188 189 options: Object (optional) 190 Options. 191 192 options.encoding: string|null (optional) 193 Specifies how Buffer objects should be decoded to strings. Default: 194 null. 195 196 options.highWaterMark: integer (optional) 197 Specifies the maximum number of objects to store in an internal buffer 198 before ceasing to generate additional pseudorandom numbers. 199 200 options.iter: integer (optional) 201 Number of iterations. 202 203 options.prng: Function (optional) 204 Pseudorandom number generator (PRNG) for generating uniformly 205 distributed pseudorandom numbers on the interval `[0,1)`. If provided, 206 the `state` and `seed` options are ignored. In order to seed the 207 returned iterator, one must seed the provided `prng` (assuming the 208 provided `prng` is seedable). 209 210 options.seed: integer|ArrayLikeObject<integer> (optional) 211 Pseudorandom number generator seed. The seed may be either a positive 212 unsigned 32-bit integer or, for arbitrary length seeds, an array-like 213 object containing unsigned 32-bit integers. 214 215 options.state: Uint32Array (optional) 216 Pseudorandom number generator state. If provided, the `seed` option is 217 ignored. 218 219 options.copy: boolean (optional) 220 Boolean indicating whether to copy a provided pseudorandom number 221 generator state. Setting this option to `false` allows sharing state 222 between two or more pseudorandom number generators. Setting this option 223 to `true` ensures that a returned iterator has exclusive control over 224 its internal state. Default: true. 225 226 options.siter: integer (optional) 227 Number of iterations after which to emit the PRNG state. Default: 1e308. 228 229 Returns 230 ------- 231 stream: ReadableStream 232 Readable stream operating in "objectMode". 233 234 stream.PRNG: Function 235 Underlying pseudorandom number generator. 236 237 stream.seed: Uint32Array|null 238 Pseudorandom number generator seed. 239 240 stream.seedLength: integer|null 241 Length of generator seed. 242 243 stream.state: Uint32Array|null 244 Generator state. 245 246 stream.stateLength: integer|null 247 Length of generator state. 248 249 stream.byteLength: integer|null 250 Size (in bytes) of generator state. 251 252 Examples 253 -------- 254 > function fcn( v ) { console.log( v ); }; 255 > var opts = { 'iter': 10 }; 256 > var s = {{alias}}.objectMode( 2.0, 5.0, opts ); 257 > var o = {{alias:@stdlib/streams/node/inspect-sink}}.objectMode( fcn ); 258 > s.pipe( o ); 259 260 See Also 261 -------- 262