/**
 * Returns a random integer between [0, maxValue).
 */ export const randomInt = ( maxValue ) : number => { return Math . floor ( Math . random ( ) * maxValue ) ; } ; /**
 * Hashes a string using polynomial hashing.
 */ export const hashString = ( s ) : number => { const A = 3 ; const P = 1000000007 ; let result = 0 ; for ( const c of s ) { result = ( result * A + c . charCodeAt ( 0 ) ) % P ; } return result ; } ;