Skip to content

Commit

Permalink
docs: better features seo
Browse files Browse the repository at this point in the history
  • Loading branch information
jeanlescure committed Apr 29, 2024
1 parent 0db7cd0 commit 537fb3e
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ For more information regarding this decision you can view [issue #53](https://gi

### Features

The ability to generate UUIDs that contain a timestamp which can be extracted:
#### Ability to generate UUIDs that contain a timestamp which can be extracted:

```js
// js/ts
Expand Down Expand Up @@ -114,8 +114,7 @@ $ suid -p lW611f30a2ky4276g3l8N7nBHI5AQ5rCiwYzU47HP2
2021-08-20T04:33:38.000Z
```

Default dictionaries (generated on the spot to reduce memory footprint and
avoid dictionary injection vulnerabilities):
#### Default dictionaries (generated on the spot to reduce memory footprint and avoid dictionary injection vulnerabilities):

- number
- alpha
Expand All @@ -142,7 +141,7 @@ console.log(uid.dict.join());
// A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z
```

Ability to use custom formatting.
#### Ability to use custom formatting

Where `$r` is random UUID, `$s` is sequential UUID, and `$t` is timestamp UUID:

Expand All @@ -154,7 +153,7 @@ console.log(result);
// Time: 63d5e631 ID: 0b-aaab
```

Ability to validate UUIDs against the instance dictionary or a provided dictionary for improved data integrity and consistency.
#### Ability to validate UUIDs against the instance dictionary or a provided dictionary

Example of using .validate() method:

Expand All @@ -170,7 +169,15 @@ const uuid = uid.stamp(32); // Generate a UUID
const isValid = uid.validate(uuid);

console.log(`Is the UUID valid? ${isValid}`);
``

// -----------

// Validate the generated UUID against the provided dictionary
const customDictionary = ['a', 'b', /* ... */];
const isValid = uid.validate(uuid, customDictionary);

console.log(`Is the UUID valid? ${isValid}`);
```

### Use in CLI

Expand Down

0 comments on commit 537fb3e

Please sign in to comment.