-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14 from atsushi130/release/v0.1.3
Released v0.1.3
- Loading branch information
Showing
10 changed files
with
62 additions
and
49 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,16 @@ | ||
[package] | ||
name = "cryptor" | ||
version = "0.1.2" | ||
version = "0.1.3" | ||
authors = ["atsushi130 <[email protected]>"] | ||
license = "MIT/Apache-2.0" | ||
description = "Cryptor is encryption machine corresponding to the diversity of algorithms." | ||
readme = "README.md" | ||
repository = "https://github.com/atsushi130/Cryptor" | ||
keywords = ["enigma", "cipher", "encrypt", "decrypt", "base64"] | ||
|
||
[badges] | ||
travis-ci = { repository = "atsushi130/Cryptor" } | ||
|
||
[dependencies] | ||
lazy_static = "0.2.8" | ||
base64 = "~0.5.0" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,24 @@ | ||
# Cryptor | ||
[![MIT / Apache2.0 dual licensed](https://img.shields.io/badge/dual%20license-MIT%20/%20Apache%202.0-blue.svg)](./LICENSE.md) | ||
[![MIT / Apache2.0 dual licensed](https://img.shields.io/badge/dual%20license-MIT%20/%20Apache%202.0-blue.svg)](./LICENSE-MIT.md) | ||
[![Travis Build Status](https://api.travis-ci.org/atsushi130/Cryptor.svg?branch=master)](https://travis-ci.org/atsushi130/Cryptor) | ||
[![crates.io](https://img.shields.io/crates/v/cryptor.svg)](https://crates.io/crates/cryptor) | ||
[![Document](https://img.shields.io/badge/Cryptor-Document-3B5998.svg)](https://docs.rs/cryptor/0.1.1/cryptor/) | ||
[![Document](https://img.shields.io/badge/Cryptor-Document-3B5998.svg)](https://docs.rs/cryptor/0.1.3/cryptor/) | ||
|
||
Cryptor is encryption machine corresponding to the diversity of algorithms. | ||
|
||
## Dependencies | ||
Insert to Cargo.toml of your project. | ||
```toml | ||
[dependencies] | ||
cryptor = "0.1.2" | ||
cryptor = "0.1.3" | ||
``` | ||
or | ||
```console | ||
// Newest version | ||
❯ cargo add cryptor | ||
|
||
// Version specification | ||
❯ cargo add [email protected].2 | ||
❯ cargo add [email protected].3 | ||
|
||
// If not exist on crates.io | ||
❯ mkdir lib | ||
|
@@ -51,12 +51,10 @@ pub trait Algorithm { | |
|
||
Cryptor have member with Algorithm trait. Dependency injection your implemented structure to Cryptor. | ||
```rust | ||
let mut cryptor = Cryptor { | ||
algorithm: YourAlgorithm { ... } | ||
}; | ||
let mut cryptor = Cryptor::new(YourAlgorithm); | ||
``` | ||
|
||
Return type of encrypt and decrypt method is `CryptoValue<YourAlgorithm>`; | ||
Return type of encrypt and decrypt method is `CryptoValue<YourAlgorithm>`. | ||
```rust | ||
let encrypted: CryptoValue<YourAlgorithm> = cryptor.encrypt(&string); | ||
println!("encrypted string is {}", encrypted.text); | ||
|
@@ -65,19 +63,6 @@ let decrypted: CryptoValue<YourAlgorithm> = cryptor.decrypt(&string); | |
println!("decrypted string is {}", decrypted.text); | ||
``` | ||
|
||
Encrypter have member with Algorithm trait. Dependency injection your implemented structure to Encrypter. | ||
```rust | ||
let mut encrypter = Encrypter { | ||
hash: YourAlgorithm { ... } | ||
}; | ||
``` | ||
|
||
Return type of encrypt method is `EncryptValue<YourAlgorithm>`. | ||
```rust | ||
let encrypted: EncryptValue<YourAlgorithm> = encrypter.encrypt(&character); | ||
println!("encrypted character is {}", encrypted.text); | ||
``` | ||
|
||
## Run | ||
```console | ||
❯ cargo build | ||
|
@@ -91,5 +76,23 @@ println!("encrypted character is {}", encrypted.text); | |
|
||
``` | ||
|
||
## Change logs | ||
**v0.1.3** | ||
Defined associated function to builds new Cryptor. | ||
```rust | ||
impl<T: Algorithm> Cryptor<T> { | ||
pub fn new(algorithm: T) -> Self { | ||
Cryptor { | ||
algorithm | ||
} | ||
} | ||
} | ||
``` | ||
|
||
**changed usage** | ||
```rust | ||
let mut cryptor = Cryptor::new(your_algorithm); | ||
``` | ||
|
||
## LICENSE | ||
**This project is dual-licensed under MIT and Apache 2.0.** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters