Skip to content

Commit c5f34f4

Browse files
committed
docs: Remove examples
1 parent 4393abb commit c5f34f4

File tree

7 files changed

+0
-153
lines changed

7 files changed

+0
-153
lines changed

crates/abcrypt/README.md

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -23,29 +23,6 @@ Add this to your `Cargo.toml`:
2323
abcrypt = "0.3.6"
2424
```
2525

26-
### Example
27-
28-
```rust
29-
use abcrypt::Params;
30-
31-
let data = b"Hello, world!\n";
32-
let passphrase = "passphrase";
33-
34-
// Encrypt `data` using `passphrase`.
35-
let ciphertext = abcrypt::encrypt(data, passphrase).unwrap();
36-
assert_ne!(ciphertext, data);
37-
38-
// And extract the Argon2 parameters from it.
39-
let params = Params::new(&ciphertext).unwrap();
40-
assert_eq!(params.memory_cost(), 19456);
41-
assert_eq!(params.time_cost(), 2);
42-
assert_eq!(params.parallelism(), 1);
43-
44-
// And decrypt it back.
45-
let plaintext = abcrypt::decrypt(ciphertext, passphrase).unwrap();
46-
assert_eq!(plaintext, data);
47-
```
48-
4926
### Crate features
5027

5128
#### `alloc`

crates/python/README.md

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -26,31 +26,6 @@ To install this library:
2626
pip install abcrypt-py
2727
```
2828

29-
### Example
30-
31-
```py
32-
from typing import Final
33-
34-
import abcrypt_py
35-
36-
DATA: Final[bytes] = b"Hello, world!\n"
37-
PASSPHRASE: Final[bytes] = b"passphrase"
38-
39-
# Encrypt `DATA` using `PASSPHRASE`.
40-
ciphertext = abcrypt_py.encrypt(DATA, PASSPHRASE)
41-
assert ciphertext != DATA
42-
43-
# And extract the Argon2 parameters from it.
44-
params = abcrypt_py.Params(ciphertext)
45-
assert params.memory_cost == 19456
46-
assert params.time_cost == 2
47-
assert params.parallelism == 1
48-
49-
# And decrypt it back.
50-
plaintext = abcrypt_py.decrypt(ciphertext, PASSPHRASE)
51-
assert plaintext == DATA
52-
```
53-
5429
### Documentation
5530

5631
See the [documentation][docs-url] for more details.

crates/wasm/README.md

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -35,31 +35,6 @@ wasm-pack build
3535

3636
This will generate build artifacts in the `pkg` directory.
3737

38-
### Example
39-
40-
```ts
41-
import * as assert from "jsr:@std/assert";
42-
43-
import * as abcrypt from "./pkg/abcrypt_wasm.js";
44-
45-
const data = new TextEncoder().encode("Hello, world!\n");
46-
const passphrase = new TextEncoder().encode("passphrase");
47-
48-
// Encrypt `data` using `passphrase`.
49-
const ciphertext = abcrypt.encrypt(data, passphrase);
50-
assert.assertNotEquals(ciphertext, data);
51-
52-
// And extract the Argon2 parameters from it.
53-
const params = new abcrypt.Params(ciphertext);
54-
assert.assertEquals(params.memoryCost, 19456);
55-
assert.assertEquals(params.timeCost, 2);
56-
assert.assertEquals(params.parallelism, 1);
57-
58-
// And decrypt it back.
59-
const plaintext = abcrypt.decrypt(ciphertext, passphrase);
60-
assert.assertEquals(plaintext, data);
61-
```
62-
6338
### Documentation
6439

6540
See the [documentation][docs-url] for more details.

docs/book/modules/lib/nav.adoc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,5 @@
55
.Library
66
* xref:index.adoc[Introduction]
77
* xref:usage.adoc[]
8-
* xref:examples.adoc[]
98
* https://docs.rs/abcrypt[API Reference]
109
* xref:changelog.adoc[]

docs/book/modules/lib/pages/examples.adoc

Lines changed: 0 additions & 27 deletions
This file was deleted.

docs/book/modules/python/pages/usage.adoc

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -11,29 +11,3 @@
1111
----
1212
pip install abcrypt-py
1313
----
14-
15-
== Example
16-
17-
[source,py]
18-
----
19-
from typing import Final
20-
21-
import abcrypt_py
22-
23-
DATA: Final[bytes] = b"Hello, world!\n"
24-
PASSPHRASE: Final[bytes] = b"passphrase"
25-
26-
# Encrypt `DATA` using `PASSPHRASE`.
27-
ciphertext = abcrypt_py.encrypt(DATA, PASSPHRASE)
28-
assert ciphertext != DATA
29-
30-
# And extract the Argon2 parameters from it.
31-
params = abcrypt_py.Params(ciphertext)
32-
assert params.memory_cost == 19456
33-
assert params.time_cost == 2
34-
assert params.parallelism == 1
35-
36-
# And decrypt it back.
37-
plaintext = abcrypt_py.decrypt(ciphertext, PASSPHRASE)
38-
assert plaintext == DATA
39-
----

docs/book/modules/wasm/pages/usage.adoc

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -23,29 +23,3 @@ wasm-pack build
2323
----
2424

2525
This will generate build artifacts in the `pkg` directory.
26-
27-
== Example
28-
29-
[source,ts]
30-
----
31-
import * as assert from "jsr:@std/assert";
32-
33-
import * as abcrypt from "./pkg/abcrypt_wasm.js";
34-
35-
const data = new TextEncoder().encode("Hello, world!\n");
36-
const passphrase = new TextEncoder().encode("passphrase");
37-
38-
// Encrypt `data` using `passphrase`.
39-
const ciphertext = abcrypt.encrypt(data, passphrase);
40-
assert.assertNotEquals(ciphertext, data);
41-
42-
// And extract the Argon2 parameters from it.
43-
const params = new abcrypt.Params(ciphertext);
44-
assert.assertEquals(params.memoryCost, 19456);
45-
assert.assertEquals(params.timeCost, 2);
46-
assert.assertEquals(params.parallelism, 1);
47-
48-
// And decrypt it back.
49-
const plaintext = abcrypt.decrypt(ciphertext, passphrase);
50-
assert.assertEquals(plaintext, data);
51-
----

0 commit comments

Comments
 (0)