Commit 54189492 authored by Marek Kotewicz's avatar Marek Kotewicz
Browse files

workaround for missing Uint16Array on android

parent 1cf55d89
......@@ -2,7 +2,7 @@ import dictionary from '../../res/words.json'
// TODO: make it secure!
export function words() {
let buf = (new Uint16Array(11)).map(_ => Math.random() * dictionary.length)
return Array.from(buf).map(n => dictionary[n]).join(' ')
let buf = Array.apply(null, { length: 11 }).map(Function.call, () => Math.random() * dictionary.length)
return buf.map(n => dictionary[Math.floor(n)]).join(' ')
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment