diff --git a/squarenotsquare/src/libs/Random.js b/squarenotsquare/src/libs/Random.js index ceec7c6..9da374b 100644 --- a/squarenotsquare/src/libs/Random.js +++ b/squarenotsquare/src/libs/Random.js @@ -19,4 +19,17 @@ export function generateKey() { } return result.join(''); +} + +export function generateSquareChallenge(){ + let result = []; + let uintArray = new Uint8Array(20); + let newChallenge = crypto.getRandomValues(uintArray); + + for(let i = 0; i < 20; ++i){ + let position = newChallenge[i] % 2; + result.push(position); + } + + return result; } \ No newline at end of file