improve docs
This commit is contained in:
parent
da155441f9
commit
4ceb59d052
2 changed files with 5 additions and 1 deletions
|
@ -1,3 +1,4 @@
|
||||||
|
//! This module translates text
|
||||||
use crate::core;
|
use crate::core;
|
||||||
|
|
||||||
/// Encodes text into catspeak using any base up to [`max_base()`]
|
/// Encodes text into catspeak using any base up to [`max_base()`]
|
||||||
|
|
|
@ -1,13 +1,15 @@
|
||||||
|
//! This module handles base 4, like the original [Cat2Text](https://github.com/Evelyn3440/Cat2Text); it can translate either english text a-z, or byte arrays (see [`bytes`])
|
||||||
use crate::core;
|
use crate::core;
|
||||||
use crate::anybase;
|
use crate::anybase;
|
||||||
|
|
||||||
|
/// Returns the alphabet used by `cat2text::base4`
|
||||||
pub fn alphabet() -> Vec<String> {
|
pub fn alphabet() -> Vec<String> {
|
||||||
let mut tmp = core::alphabet();
|
let mut tmp = core::alphabet();
|
||||||
tmp.truncate(4);
|
tmp.truncate(4);
|
||||||
return tmp;
|
return tmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// How many words long a character is when translated to catspeak
|
/// How many words long an english character is when translated to catspeak
|
||||||
pub fn char_length() -> u32 {
|
pub fn char_length() -> u32 {
|
||||||
return 3;
|
return 3;
|
||||||
}
|
}
|
||||||
|
@ -36,6 +38,7 @@ pub fn decode(text: String) -> String {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub mod bytes {
|
pub mod bytes {
|
||||||
|
//! This handles encoding and decoding bytes to/from catspeak
|
||||||
use crate::anybase;
|
use crate::anybase;
|
||||||
use super::char_length;
|
use super::char_length;
|
||||||
/// Encodes from bytes into catspeak
|
/// Encodes from bytes into catspeak
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue