jlib 0.3.7

A lightweight blockchain lib.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
extern crate rand;
use rand::Rng;

pub struct Brorand {}
impl Brorand {
    //random generate a specific length's [u8]
    pub fn brorand(len: usize) -> Vec<u8> {
        let u: Vec<u8> = (0..len).map(|_| {
            let idx: u8 = rand::thread_rng().gen();
            // let _hexs = format!("{:x}", idx);
            idx
        }).collect::<Vec<u8>>();

        u
    }
}