The communications platform that puts data protection first.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Rocket.Chat/lib/random.ts

16 lines
517 B

import { Random } from 'meteor/random';
/**
* Facade for Meteor's `Random.id` function
*
* @param length length of the identifier in characters
* @returns a unique identifier, such as `"Jjwjg6gouWLXhMGKW"`, that is likely to be unique in the whole world
*/
export const getRandomId = (length?: number): string => Random.id(length);
/**
* Facade for Meteor's `Random.fraction` function
*
* @returns a strong random number between 0 and 1
*/
export const getRandomFraction = (): number => Random.fraction();