pub fn verify(content: &str) -> Result<(), VerificationError> {
    let bytes = content.as_bytes();

    // Check length.
    let remaining_bytes = bytes.len() - bytes.len() / 11 * 11;
    if let 1 | 4 | 8 = remaining_bytes {
        return Err(VerificationError::InvalidLength);
    }

    // Check chars.
    for (index, c) in bytes.iter().enumerate() {
        if CHAR_RANGE_UPPERCASE.contains(c) {
            if let b'O' | b'I' = *c {
                return Err(VerificationError::InvalidByte { index, byte: *c });
            }
        } else if !CHAR_RANGE_NUMBERS.contains(c) && !CHAR_RANGE_LOWERCASE.contains(c) {
            return Err(VerificationError::InvalidByte { index, byte: *c });
        }
    }

    Ok(())
}
/// Verifies `content` is a valid G60 encoded string.
///
/// # Errors
/// An error will be thrown in the following cases:
/// - if `content` is not a valid G60 encoded string.
Verifies `content` is a valid G60 encoded string.
Verifies ` content ` is a valid G60 encoded string .
pub fn verify(content: &str) -> Result<(), VerificationError> {
    let bytes = content.as_bytes();
    // Check length.
    let remaining_bytes = bytes.len() - bytes.len() / 11 * 11;
    if let 1 | 4 | 8 = remaining_bytes {
        return Err(VerificationError::InvalidLength);
    }
    // Check chars.
    for (index, c) in bytes.iter().enumerate() {
        if CHAR_RANGE_UPPERCASE.contains(c) {
            if let b'O' | b'I' = *c {
                return Err(VerificationError::InvalidByte { index, byte: *c });
            }
        } else if !CHAR_RANGE_NUMBERS.contains(c) && !CHAR_RANGE_LOWERCASE.contains(c) {
            return Err(VerificationError::InvalidByte { index, byte: *c });
        }
    }
    Ok(())
}
pub fn verify ( content : & str ) -> Result < ( ) , VerificationError > { let bytes = content . as_bytes ( ) ; // Check length. let remaining_bytes = bytes . len ( ) - bytes . len ( ) / 11 * 11 ; if let 1 | 4 | 8 = remaining_bytes { return Err ( VerificationError :: InvalidLength ) ; } // Check chars. for ( index , c ) in bytes . iter ( ) . enumerate ( ) { if CHAR_RANGE_UPPERCASE . contains ( c ) { if let b'O' | b'I' = * c { return Err ( VerificationError :: InvalidByte { index , byte : * c } ) ; } } else if ! CHAR_RANGE_NUMBERS . contains ( c ) && ! CHAR_RANGE_LOWERCASE . contains ( c ) { return Err ( VerificationError :: InvalidByte { index , byte : * c } ) ; } } Ok ( ( ) ) }
Verifies `content` is a valid G60 encoded string.
Verifies ` content ` is a valid G60 encoded string .
content
&str
content
&str
errors
An error will be thrown in the following cases:
if `content` is not a valid G60 encoded string.
An error will be thrown in the following cases : if ` content ` is not a valid G60 encoded string .