smartunique/ts/index.ts

20 lines
507 B
TypeScript
Raw Permalink 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
*/
2017-07-17 15:01:10 +00:00
export let 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
*/
2017-07-17 15:01:10 +00:00
export let uuid4 = (): string => {
2018-10-06 13:38:55 +00:00
return plugins.uuidv4();
};
2017-07-14 16:53:10 +00:00
2017-07-17 15:01:10 +00:00
export let uuid5 = (customStringArg: string, namespaceArg = plugins.uuidv5.DNS): string => {
2018-10-06 13:38:55 +00:00
return plugins.uuidv5(customStringArg, namespaceArg);
};