(options?: GenerateOptions)
| 50 | } |
| 51 | |
| 52 | export function resolveRng(options?: GenerateOptions): RngFunction { |
| 53 | if (options?.rng) return options.rng |
| 54 | |
| 55 | if (options?.rngProfile && rngRegistry.has(options.rngProfile)) { |
| 56 | return rngRegistry.get(options.rngProfile)! |
| 57 | } |
| 58 | |
| 59 | if (options?.mode === 'banking') { |
| 60 | return rngRegistry.get('secure') ?? defaultSecureRng |
| 61 | } |
| 62 | |
| 63 | return rngRegistry.get('insecure') ?? defaultInsecureRng |
| 64 | } |