Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ pub fn encode_lower_to_fmt<Ck: Checksum, W: fmt::Write>(
Ok(())
}

/// Encodes `data` to a writer ([`fmt::Write`]) as a uppercase bech32 encoded string.
/// Encodes `data` to a writer ([`fmt::Write`]) as an uppercase bech32 encoded string.
///
/// Encoded string will be prefixed with the `hrp` and have a checksum appended as specified by the
/// `Ck` algorithm (`NoChecksum` to exclude checksum all together).
Expand Down Expand Up @@ -399,7 +399,7 @@ pub fn encode_lower_to_writer<Ck: Checksum, W: std::io::Write>(
Ok(())
}

/// Encodes `data` to a writer ([`io::Write`]) as a uppercase bech32 encoded string.
/// Encodes `data` to a writer ([`io::Write`]) as an uppercase bech32 encoded string.
///
/// Encoded string will be prefixed with the `hrp` and have a checksum appended as specified by the
/// `Ck` algorithm (`NoChecksum` to exclude checksum all together).
Expand Down Expand Up @@ -757,7 +757,7 @@ mod tests {

#[test]
fn can_decode_segwit_too_long_string() {
// A 91 character long string, greater than the segwit enforced maximum of 90.
// A 91 character long string, greater than the segwit enforced maximum of 90.
let s = "abcd1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqrw9z3s";
assert!(decode(s).is_ok());
}
Expand Down
4 changes: 2 additions & 2 deletions src/primitives/correction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ pub struct Corrector<Ck: Checksum> {

impl<Ck: Checksum> Corrector<Ck> {
/// A bound on the number of errors and erasures (errors with known location)
/// can be corrected by this corrector.
/// that can be corrected by this corrector.
///
/// Returns N such that, given E errors and X erasures, correction is possible
/// iff 2E + X <= N.
Expand Down Expand Up @@ -288,7 +288,7 @@ impl<Ck: Checksum> Iterator for ErrorIterator<'_, Ck> {
// (a^i)^(c - 1)) locator_derivative(a^-i)
//
// where here a is `Ck::ROOT_GENERATOR`, c is the first element of the range
// `Ck::ROOT_EXPONENTS`, and both evalutor and locator_derivative are polynomials
// `Ck::ROOT_EXPONENTS`, and both evaluator and locator_derivative are polynomials
// which are computed when constructing the ErrorIterator.

let a_i = self.a.powi(neg_i as i64);
Expand Down
8 changes: 4 additions & 4 deletions src/primitives/decode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ const SEP: char = '1';
/// } else if unchecked.has_valid_checksum::<Bech32m>() {
/// // Remove the checksum and do something with the data as above.
/// } else {
/// // Checksum is not valid for either the bech32 or bech32 checksum algorithms.
/// // Checksum is not valid for either the bech32 or bech32m checksum algorithms.
/// }
/// ```
#[derive(Debug)]
Expand All @@ -125,7 +125,7 @@ pub struct UncheckedHrpstring<'s> {
}

impl<'s> UncheckedHrpstring<'s> {
/// Parses an bech32 encode string and constructs a [`UncheckedHrpstring`] object.
/// Parses an bech32 encode string and constructs an [`UncheckedHrpstring`] object.
///
/// Checks for valid ASCII values, does not validate the checksum.
#[inline]
Expand Down Expand Up @@ -279,7 +279,7 @@ impl<'s> UncheckedHrpstring<'s> {
Ok(())
}

/// Removes the checksum for the `Ck` algorithm and returns an [`CheckedHrpstring`].
/// Removes the checksum for the `Ck` algorithm and returns a [`CheckedHrpstring`].
///
/// Data must be valid (ie, first call `has_valid_checksum` or `validate_checksum()`). This
/// function is typically paired with `has_valid_checksum` when validating against multiple
Expand Down Expand Up @@ -329,7 +329,7 @@ pub struct CheckedHrpstring<'s> {
hrp: Hrp,
/// This is ASCII byte values of the parsed string, guaranteed to be valid bech32 characters.
///
/// The characters after the '1' separator and the before the checksum.
/// The characters after the '1' separator and before the checksum.
ascii: &'s [u8],
/// The length of the parsed hrpstring.
hrpstring_length: usize, // Guaranteed to be <= CK::CODE_LENGTH
Expand Down
4 changes: 2 additions & 2 deletions src/primitives/lfsr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ mod tests {
// the "2L <= N" path with x != L.
LfsrIter::berlekamp_massey(&[Fe32::Q, Fe32::Y, Fe32::H]).take(10).count();

// Hits the the "2L <= N" path with x != L, without overflowing subtraction
// Hits the "2L <= N" path with x != L, without overflowing subtraction
// as in the above vector.
let sequence: Vec<_> =
LfsrIter::berlekamp_massey(&[Fe32::Y, Fe32::H, Fe32::Q, Fe32::Q]).take(10).collect();
Expand All @@ -254,7 +254,7 @@ mod tests {
// This vector specifically exercises the Step 5 update path
// Step 5 runs when old_conn.len() + x > conn.len()
// where old_conn is multiplied into the update term
// replacing '*' with '/' there changes output.
// replacing '*' with '/' there changes output.
let step5_sequence: Vec<_> =
LfsrIter::berlekamp_massey(&[Fe32::A, Fe32::C, Fe32::A, Fe32::Y, Fe32::A])
.take(4)
Expand Down
2 changes: 1 addition & 1 deletion src/primitives/polynomial.rs
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ impl<F: Field> Polynomial<F> {
// search them. In practice this doesn't matter because we have
// such a small number of roots (it may actually be faster than
// using a hashset) and because the root-finding takes such a
// long time that noboby can use this method in a loop anyway.
// long time that nobody can use this method in a loop anyway.
let mut len = 2;
while let Ok(k) = roots[..].binary_search(&((r2 + ratio) % E::MULTIPLICATIVE_ORDER))
{
Expand Down
Loading