Skip to content

Commit

Permalink
README.md: make nanoidgen
Browse files Browse the repository at this point in the history
  • Loading branch information
lukateras committed Dec 12, 2024
1 parent 6ff7866 commit 24cab03
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 10 deletions.
14 changes: 9 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,11 @@ Works out of the box on NetBSD, OpenBSD, Linux, Android, macOS, iOS, illumos,
FreeBSD, DragonFly, Haiku, Fuchsia, WASI, and Emscripten. Windows support
requires a [`getentropy(3)`][] shim.

To build just [`nanoidgen(1)`][], run `make nanoidgen`. No `Makefile` required.

## Usage

### [`nanoid(3)`](https://lukateras.github.io/nanoid.h/nanoid.3.html)
### [`nanoid(3)`][]

```c
#include <nanoid.h>
Expand All @@ -70,15 +72,17 @@ requires a [`getentropy(3)`][] shim.
Returns a newly allocated null-terminated string with the ID, or `NULL` if
[`calloc(3)`][] or [`getentropy(3)`][] fail.

[`calloc(3)`]: https://pubs.opengroup.org/onlinepubs/9799919799/functions/calloc.html
[`getentropy(3)`]: https://pubs.opengroup.org/onlinepubs/9799919799/functions/getentropy.html

### [`nanoidgen(1)`](https://lukateras.github.io/nanoid.h/nanoidgen.1.html)
### [`nanoidgen(1)`][]

```
nanoidgen [length]
```

[`calloc(3)`]: https://pubs.opengroup.org/onlinepubs/9799919799/functions/calloc.html
[`getentropy(3)`]: https://pubs.opengroup.org/onlinepubs/9799919799/functions/getentropy.html
[`nanoid(3)`]: https://lukateras.github.io/nanoid.h/nanoid.3.html
[`nanoidgen(1)`]: https://lukateras.github.io/nanoid.h/nanoidgen.1.html

## Attribution

Port of [Nano ID](https://github.com/ai/nanoid) by [Andrey Sitnik](https://sitnik.ru).
Expand Down
14 changes: 9 additions & 5 deletions openbsd/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,13 @@ Works out of the box on OpenBSD, NetBSD, Linux, Android, macOS, iOS, illumos,
FreeBSD, DragonFly, Haiku, Fuchsia, WASI, and Emscripten. Windows support
requires a [`getentropy(2)`][] shim.

To build just [`nanoidgen(1)`][], run `make nanoidgen`. No `Makefile` required.

## Usage

For details, consult `nanoid(3)` and `nanoidgen(1)` man pages.

### [`nanoid(3)`](https://lukateras.github.io/nanoid.h/openbsd/nanoid.3.html)
### [`nanoid(3)`][]

```c
#include <nanoid.h>
Expand All @@ -72,15 +74,17 @@ For details, consult `nanoid(3)` and `nanoidgen(1)` man pages.
Returns a newly allocated null-terminated string with the ID, or `NULL` if
[`calloc(3)`][] or [`getentropy(2)`][] fail.

[`calloc(3)`]: https://man.openbsd.org/calloc.3
[`getentropy(2)`]: https://man.openbsd.org/getentropy.2

### [`nanoidgen(1)`](https://lukateras.github.io/nanoid.h/nanoidgen.1.html)
### [`nanoidgen(1)`][]

```
nanoidgen [length]
```

[`calloc(3)`]: https://man.openbsd.org/calloc.3
[`getentropy(2)`]: https://man.openbsd.org/getentropy.2
[`nanoid(3)`]: https://lukateras.github.io/nanoid.h/openbsd/nanoid.3.html
[`nanoidgen(1)`]: https://lukateras.github.io/nanoid.h/nanoidgen.1.html

## Attribution

Port of [Nano ID](https://github.com/ai/nanoid) by [Andrey Sitnik](https://sitnik.ru).
Expand Down

0 comments on commit 24cab03

Please sign in to comment.