| Crates.io | nucleociph |
| lib.rs | nucleociph |
| version | 1.0.1 |
| created_at | 2023-08-01 19:38:34.238169+00 |
| updated_at | 2023-08-04 15:37:44.568362+00 |
| description | A library for encoding phrases into nucleotide characters, and vice versa. |
| homepage | |
| repository | https://github.com/aidenzepp/nucleociph |
| max_upload_size | |
| id | 932142 |
| size | 5,573 |
nucleociph is a simple library for encoding and decoding strings into and from a DNA-based cipher.
In this library, each character in a string is treated as a sequence of 8 bits. These bits are grouped into pairs and encoded as 'A', 'T', 'G', or 'C'. 'A' represents the bit pair "00", 'T' represents "01", 'C' represents "10", and 'G' represents "11".
You can use this library to:
Add nucleociph to your Cargo.toml:
[dependencies]
nucleociph = "1.0.1"
use nucleociph::{decode, encode};
let phrase: String = "Hello World!".to_string();
let cipher: String = encode(phrase.clone());
assert_eq!(phrase, decode(cipher));
nucleociph is distributed under the terms of the MIT license.