Skip to content

UUID Standards

UUID (Universally unique identifier) is a type of unique label used through various computer systems (see more).

These Standard Value Generators tries to support it in your Falsa to ease the whole process of generating falsum data.

Warning

Keep in mind this implementation does not aim on secure randoms; some collisions might possibly occur.

uuid Standard

This is a basic Standard Value Generator providing a service of generating UUIDs. In this case, it generates them built of lowercase hexadecimal characters (for uppercase version, use UUID Standard).

Examples

const generator = new UUIDGenerator();
console.log(generator.generate());

Output

'fd1e9650-d9bc-43c9-3cf1-9b39449908a6'
const generator = getStandard('uuid');
console.log(generator.generate());

Output

'fd1e9650-d9bc-43c9-3cf1-9b39449908a6'
1
2
3
4
5
6
7
8
9
const schema: SchemaInput = {
    fields: {
        value: 'uuid'
    }
}

const fabricator = new Fabricator(schema);

console.log(fabricator.generate());

Output

{ value: 'fd1e9650-d9bc-43c9-3cf1-9b39449908a6' }

UUID Standard

This Standard Value Generator generates UUIDs - similarly as uuid Standard, however the generated value is built of uppercase hexadecimal values.

Examples

const generator = new UUIDGenerator({ uppercase: true });
console.log(generator.generate());

Output

'9364B9C8-4A89-429C-B224-C185DABC5619'
const generator = getStandard('UUID');
console.log(generator.generate());

Output

'9364B9C8-4A89-429C-B224-C185DABC5619'
1
2
3
4
5
6
7
8
9
const schema: SchemaInput = {
    fields: {
        value: 'UUID'
    }
}

const fabricator = new Fabricator(schema);

console.log(fabricator.generate());

Output

{ value: '9364B9C8-4A89-429C-B224-C185DABC5619' }