diff --git a/crates/starknet-types-core/src/felt.rs b/crates/starknet-types-core/src/felt.rs index 8b8470d..9b5f59d 100644 --- a/crates/starknet-types-core/src/felt.rs +++ b/crates/starknet-types-core/src/felt.rs @@ -86,7 +86,8 @@ impl Felt { pub fn from_bytes_be_slice(bytes: &[u8]) -> Self { // NB: lambdaworks ignores the remaining bytes when len > 32, so we loop // multiplying by BASE, effectively decomposing in base 2^256 to build - // digits with a length of 32 bytes. + // digits with a length of 32 bytes. This is analogous to splitting the + // number `xyz` as `x * 10^2 + y * 10^1 + z * 10^0`. const BASE: Felt = Self(FieldElement::::const_from_raw( UnsignedInteger::from_limbs([ 576413109808302096, @@ -129,7 +130,8 @@ impl Felt { pub fn from_bytes_le_slice(bytes: &[u8]) -> Self { // NB: lambdaworks ignores the remaining bytes when len > 32, so we loop // multiplying by BASE, effectively decomposing in base 2^256 to build - // digits with a length of 32 bytes. + // digits with a length of 32 bytes. This is analogous to splitting the + // number `xyz` as `x * 10^2 + y * 10^1 + z * 10^0`. const BASE: Felt = Self(FieldElement::::const_from_raw( UnsignedInteger::from_limbs([ 576413109808302096,