k9guard 1.0.0 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,18 +0,0 @@
1
- import { randomBytes } from 'crypto';
2
- import enData from '../locale/en.json';
3
- import trData from '../locale/tr.json';
4
-
5
- export class LogicGenerator {
6
- private static data: Record<'en' | 'tr', { question: string; answer: string }[]> = {
7
- en: enData.logics,
8
- tr: trData.logics
9
- };
10
-
11
- static getRandom(locale: 'en' | 'tr' = 'en', difficulty: 'easy' | 'medium' | 'hard' = 'easy'): { question: string; answer: string } {
12
- const logics = this.data[locale];
13
- // use crypto random to select a logic puzzle securely
14
- const buffer = randomBytes(4);
15
- const index = buffer.readUInt32LE(0) % logics.length;
16
- return logics[index]!;
17
- }
18
- }
@@ -1,18 +0,0 @@
1
- import { randomBytes } from 'crypto';
2
- import enData from '../locale/en.json';
3
- import trData from '../locale/tr.json';
4
-
5
- export class RiddleBank {
6
- private static data: Record<'en' | 'tr', { question: string; answer: string }[]> = {
7
- en: enData.riddles,
8
- tr: trData.riddles
9
- };
10
-
11
- static getRandom(locale: 'en' | 'tr' = 'en', difficulty: 'easy' | 'medium' | 'hard' = 'easy'): { question: string; answer: string } {
12
- const riddles = this.data[locale];
13
- // use crypto random to select a riddle securely
14
- const buffer = randomBytes(4);
15
- const index = buffer.readUInt32LE(0) % riddles.length;
16
- return riddles[index]!;
17
- }
18
- }