DefinitelyTyped/types/react-native-uuid/react-native-uuid-tests.ts

20 lines
447 B
TypeScript
Raw Permalink Normal View History

import uuid from 'react-native-uuid';
uuid.v1({
node: [0x01, 0x23, 0x45, 0x67, 0x89, 0xab],
clockseq: 0x1234,
msecs: new Date('2011-11-01').getTime(),
nsecs: 5678
});
uuid.v4({
random: [
0x10, 0x91, 0x56, 0xbe, 0xc4, 0xfb, 0xc1, 0xea,
0x71, 0xb4, 0xef, 0xe1, 0x67, 0x1c, 0x58, 0x36
]
});
const bytes = uuid.parse('797ff043-11eb-11e1-80d6-510998755d10');
const string = uuid.unparse(bytes);
const myUuid = uuid.noConflict();