Struct Sc

Source
pub struct Sc;
Expand description

Generator for tripcodes on 2ch.sc.

The format of resulting tripcodes is determined as follows:

  • If the password is 12 or greater bytes long and:
    • begins with '#' sign -> Nama key tripcode (生キートリップ).
    • begins with '$' sign and:
      • the '$' sign is followed by a half-width katakana character -> Katakana tripcode (カタカナトリップ).
      • else -> 15-character tripcode (15桁トリップ).
    • else -> 12-character tripcode (12桁トリップ).
  • else -> 10-character tripcode.

The following is the list of characters to be treated as half-width katakanas above:

。「」、・ヲァィゥェォャュョッーアイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワン゙゚

Trait Implementations§

Source§

impl TripcodeGenerator for Sc

Source§

type Hash = ScHash

The type of hash value that represents resulting tripcodes. Read more
Source§

fn hash<P: AsRef<[u8]>>(password: P) -> ScHash

Generates a hash value that represents the tripcode for password.
Source§

fn generate<P: AsRef<[u8]>>(password: P) -> String

Generates a tripcode from password.
Source§

fn append<P: AsRef<[u8]>>(password: P, dst: &mut String)

Generates a tripcode from password and appends it to a String.
Source§

fn write<P, W>(password: P, dst: &mut W) -> Result<()>
where P: AsRef<[u8]>, W: Write,

Generates a tripcode into a Write.
Source§

fn generate_sjis<P: AsRef<[u8]>>(password: P) -> Vec<u8>

Generates a tripcode in Shift-JIS encoding.
Source§

fn append_sjis<P: AsRef<[u8]>>(password: P, dst: &mut Vec<u8>)

Generates a Shift-JIS-encoded tripcode and appends it to a Vec<u8>.
Source§

fn write_sjis<P, W>(password: P, dst: &mut W) -> Result<()>
where P: AsRef<[u8]>, W: Write,

Generates a Shift-JIS-encoded tripcode into a Write.

Auto Trait Implementations§

§

impl Freeze for Sc

§

impl RefUnwindSafe for Sc

§

impl Send for Sc

§

impl Sync for Sc

§

impl Unpin for Sc

§

impl UnwindSafe for Sc

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> TripcodeGeneratorFailable for T

Source§

type Hash = <T as TripcodeGenerator>::Hash

The type of hash value that represents resulting tripcodes. Read more
Source§

fn try_hash<P>(password: P) -> Option<<T as TripcodeGeneratorFailable>::Hash>
where P: AsRef<[u8]>,

Attempts to generate a hash value from password. Read more
Source§

fn try_generate<P: AsRef<[u8]>>(password: P) -> Option<String>

Attempts to generate a tripcode from password. Read more
Source§

fn try_append<P: AsRef<[u8]>>(password: P, dst: &mut String) -> Option<()>

Attempts to generate a tripcode and append it to a String. Read more
Source§

fn try_write<P, W>(password: P, dst: &mut W) -> Option<Result<()>>
where P: AsRef<[u8]>, W: Write,

Attempts to generate a tripcode into a Write. Read more
Source§

fn try_generate_sjis<P: AsRef<[u8]>>(password: P) -> Option<Vec<u8>>

Attempts to generate a tripcode in Shift-JIS encoding. Read more
Source§

fn try_append_sjis<P: AsRef<[u8]>>(password: P, dst: &mut Vec<u8>) -> Option<()>

Attempts to generate a Shift-JIS-encoded tripcode and append it to a Vec<u8>. Read more
Source§

fn try_write_sjis<P, W>(password: P, dst: &mut W) -> Option<Result<()>>
where P: AsRef<[u8]>, W: Write,

Attempts to generate a Shift-JIS-encoded tripcode into a Write. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.