fix(sec): switched to cryptographically secure random

This commit is contained in:
Corentin Thomasset 2021-05-31 17:54:20 +02:00
parent 03a7e8c42d
commit 74e5758735
No known key found for this signature in database
GPG key ID: DBD997E935996158
2 changed files with 11 additions and 4 deletions

View file

@ -1,5 +1,7 @@
import {random} from './random'
const capitalise = (s: string) => s.charAt(0).toUpperCase() + s.slice(1)
const shuffle = (s: string) => s.split('').sort(() => 0.5 - Math.random()).join('')
const shuffle = (s: string) => s.split('').sort(() => 0.5 - random()).join('')
export {capitalise, shuffle}