From 2a17e89af9d612e35e8525381ddbdf3bf1f83180 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Pedro=20Sousa?= Date: Thu, 9 Mar 2023 10:24:21 +0000 Subject: [PATCH] Adding endianness, to close #65 as well --- src/standard_library/field_methods.md | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/src/standard_library/field_methods.md b/src/standard_library/field_methods.md index fc977db..59695e3 100644 --- a/src/standard_library/field_methods.md +++ b/src/standard_library/field_methods.md @@ -37,12 +37,12 @@ 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: @@ -50,7 +50,24 @@ 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); } ```