Skip to content

Commit 1fcf393

Browse files
committed
Bump version for release
1 parent 4a19563 commit 1fcf393

File tree

2 files changed

+25
-3
lines changed

2 files changed

+25
-3
lines changed

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
[package]
22
name = "secrets"
3-
version = "0.0.0"
3+
version = "0.10.0"
44
license = "MIT"
55

66
authors = ["Stephen Touset <stephen@touset.org>"]
77
description = "Protected-access memory for cryptographic secrets"
88

99
homepage = "https://github.com/stouset/secrets"
10+
repository = "https://github.com/stouset/secrets"
1011
documentation = "https://stouset.github.io/secrets"
11-
repository = "git@github.com:stouset/secrets"
1212
readme = "README.md"
1313

1414
keywords = [ "crypto", "cryptography", "allocator" ]

README.md

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,29 @@ Buffers allocated through this library:
2121
Example
2222
-------
2323

24-
Coming soon. Library very much in flux.
24+
Generating a random secret:
25+
26+
```rust
27+
use secrets::Secret;
28+
29+
let secret = Secret::random(32);
30+
let secret_r = secret.borrow();
31+
32+
println!("{:?}", secret_r.as_slice());
33+
```
34+
35+
Creating a secret from existing data:
36+
37+
```rust
38+
use secrets::Secret;
39+
40+
let mut string = "password".to_string();
41+
let secret = Secret::from(unsafe { string.as_mut_vec() });
42+
let secret_r = secret.borrow();
43+
44+
println!("{}", string); // NUL bytes
45+
println!("{:?}", secret_r.as_slice()); // b"string"
46+
```
2547

2648
Documentation
2749
-------------

0 commit comments

Comments
 (0)