provekit_noirc_driver 1.0.0-beta.20-alpha.1

Noir compiler driver.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use crate::convert::From;

impl<let N: u32> str<N> {
    /// Converts the given string into a byte array
    #[builtin(str_as_bytes)]
    pub fn as_bytes(self) -> [u8; N] {}

    /// return a byte vector of the str content
    pub fn as_bytes_vec(self: Self) -> [u8] {
        self.as_bytes().as_vector()
    }
}

impl<let N: u32> From<[u8; N]> for str<N> {
    fn from(bytes: [u8; N]) -> Self {
        bytes.as_str_unchecked()
    }
}