Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/colinnielsen/noir-u2b
u(ints) -> b(yte arrays)
https://github.com/colinnielsen/noir-u2b
aztec noir noir-lang
Last synced: 3 months ago
JSON representation
u(ints) -> b(yte arrays)
- Host: GitHub
- URL: https://github.com/colinnielsen/noir-u2b
- Owner: colinnielsen
- License: mit
- Created: 2023-07-12T14:13:27.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-02-12T23:30:14.000Z (12 months ago)
- Last Synced: 2024-08-03T16:09:54.314Z (6 months ago)
- Topics: aztec, noir, noir-lang
- Language: Roff
- Homepage:
- Size: 15.6 KB
- Stars: 7
- Watchers: 2
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-noir - U(int)2B(ytes) - a library for converting `u8`->`u120`s to `[u8]` array (Libraries / Data Type Manipulation)
README
# Noir u2b
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![Nargo Test 🌌](https://github.com/colinnielsen/noir-u2b/actions/workflows/test.yml/badge.svg)](https://github.com/colinnielsen/noir-u2b/actions/workflows/test.yml)
**Noir u2b** contains helpers functions for converting unsigned integers to `[u8]` arrays of appropriate size
## Usage
In your `Nargo.toml` file, add the following dependency:
```toml
[dependencies]
u2b = { tag = "v0.3.0", git = "https://github.com/colinnielsen/noir-u2b" }
```Conversion functions are available for all unsigned integer types `u(8-128)`. They can be used as follows:
```rust
use dep::u2b;fn main(){
let num: u16 = 256;let num_arr = u64_to_u8(num);
...
let num: u64 = 123451224112;
let num_arr: [u8; 8] = u64_to_u8(num);
}
```## License
This project is licensed under the MIT License. See the [LICENSE](https://github.com/colinnielsen/noir-array-helpers/blob/main/LICENSE) file for details.