UUID

The UUID class provides methods to make working with UUIDs easier and consistent across all Platform SDK products.

Importing the UUID class

1import { UUID } from "@ardenthq/sdk-cryptography";

Generate a UUID based on the current time

1UUID.timestamp();

Generate a MD5 UUID based on a name and namespace

1UUID.md5('name', 'namespace');

Generate a UUID based on a random value

1UUID.random();

Generate a SHA1 UUID based on a name and namespace

1UUID.sha1('name', 'namespace');

Generate a UUID based on a parse value

1UUID.parse('9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d');

Convert a buffer into a UUID

1UUID.stringify(UUID.parse('9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d'));

Validate a UUID

1UUID.validate('9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d');
Last updated 2 years ago
Edit Page
Share: