|
|
@ -17,13 +17,13 @@ impl Digest {
|
|
|
|
{
|
|
|
|
{
|
|
|
|
let mut d = Self::default();
|
|
|
|
let mut d = Self::default();
|
|
|
|
|
|
|
|
|
|
|
|
let master = usize::from(from[0]) % map::KANA.len();
|
|
|
|
let oneesan = usize::from(from[0]) % map::KANA.len();
|
|
|
|
d.0 = Some(map::KANA[master]);
|
|
|
|
d.0 = Some(map::KANA[oneesan]);
|
|
|
|
if from[1] > 0 {
|
|
|
|
if from[1] > 0 {
|
|
|
|
if let Some(slaves) = map::sub(master) {
|
|
|
|
if let Some(imoutos) = map::sub(oneesan) {
|
|
|
|
let one = (usize::from(from[1]) / map::KANA.len()) % 2;
|
|
|
|
let one = (usize::from(from[1]) / map::KANA.len()) % 2;
|
|
|
|
if slaves.len() > 0 && one > 0{
|
|
|
|
if imoutos.len() > 0 && one > 0{
|
|
|
|
d.1 = Some(slaves[usize::from(from[1]) % slaves.len()]);
|
|
|
|
d.1 = Some(imoutos[usize::from(from[1]) % imoutos.len()]);
|
|
|
|
return d;
|
|
|
|
return d;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -31,10 +31,10 @@ impl Digest {
|
|
|
|
d.1 = Self::new(&from[..]).0;
|
|
|
|
d.1 = Self::new(&from[..]).0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
d
|
|
|
|
d
|
|
|
|
/*let master = usize::from(from) % map::KANA.len();
|
|
|
|
/*let oneesan = usize::from(from) % map::KANA.len();
|
|
|
|
d.0 = Some(map::KANA[master]);
|
|
|
|
d.0 = Some(map::KANA[oneesan]);
|
|
|
|
if let Some(slaves) = map::sub(master) {
|
|
|
|
if let Some(imoutos) = map::sub(oneesan) {
|
|
|
|
if slaves.len() > 0 {
|
|
|
|
if imoutos.len() > 0 {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
|
|
|
|
|
|
|
@ -49,11 +49,11 @@ impl fmt::Display for Digest
|
|
|
|
{
|
|
|
|
{
|
|
|
|
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result
|
|
|
|
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if let Some(master) = self.0 {
|
|
|
|
if let Some(oneesan) = self.0 {
|
|
|
|
write!(f, "{}", master)?;
|
|
|
|
write!(f, "{}", oneesan)?;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if let Some(slave) = self.1 {
|
|
|
|
if let Some(imouto) = self.1 {
|
|
|
|
write!(f, "{}", slave)?;
|
|
|
|
write!(f, "{}", imouto)?;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Ok(())
|
|
|
|
Ok(())
|
|
|
|
}
|
|
|
|
}
|
|
|
|