Skip to content
This repository has been archived by the owner on Apr 20, 2023. It is now read-only.

Commit

Permalink
Adding endianness, to close #65 as well
Browse files Browse the repository at this point in the history
  • Loading branch information
signorecello committed Mar 9, 2023
1 parent eeea57e commit 2a17e89
Showing 1 changed file with 21 additions and 4 deletions.
25 changes: 21 additions & 4 deletions src/standard_library/field_methods.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,20 +37,37 @@ fn main() {
}
```

## to_radix
## to_le_radix

Decomposes into a vector over the specificed base
Decomposes into a vector over the specificed base, Little Endian

```rust
fn to_radix(_x : Field, _radix: u32, _result_len: u32) -> [u8]
fn to_le_radix(_x : Field, _radix: u32, _result_len: u32) -> [u8]
```

example:

```rust
fn main() {
const field = 2
let radix = field.to_radix(256, 4);
let radix = field.to_le_radix(256, 4);
}
```

## to_be_radix

Decomposes into a vector over the specificed base, Big Endian

```rust
fn to_be_radix(_x : Field, _radix: u32, _result_len: u32) -> [u8]
```

example:

```rust
fn main() {
const field = 2
let radix = field.to_be_radix(256, 4);
}
```

Expand Down

0 comments on commit 2a17e89

Please sign in to comment.