smartunique/ts/index.ts

22 lines
559 B
TypeScript
Raw Normal View History

2018-10-06 13:38:55 +00:00
import * as plugins from './smartunique.plugins';
2017-07-14 16:53:10 +00:00
/**
* returns short strings that are unique to very high degree od certainty
*/
2020-03-05 20:39:44 +00:00
export const shortId = (): string => {
2018-10-06 13:38:55 +00:00
return plugins.shortid.generate();
};
2017-07-14 16:53:10 +00:00
/**
* returns strings that are unique to a very high degree of certainty
*/
2020-03-05 20:39:44 +00:00
export const uuid4 = (): string => {
return plugins.uuid.v4();
2018-10-06 13:38:55 +00:00
};
2017-07-14 16:53:10 +00:00
2020-03-05 20:39:44 +00:00
export const uuid5 = (customStringArg: string, namespaceArg = plugins.uuid.v5.DNS): string => {
return plugins.uuid.v5(customStringArg, namespaceArg);
};
2020-06-05 09:11:48 +00:00
export const uni = plugins.isounique.uni;