bee-pow 1.0.0

Provides Proof of Work utilities for the IOTA protocol
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// Copyright 2020-2021 IOTA Stiftung
// SPDX-License-Identifier: Apache-2.0

use bee_block::rand::bytes::rand_bytes;
use bee_pow::providers::NonceProvider;

#[test]
fn constant_provide() {
    let bytes = rand_bytes(256);
    let nonce_1 = 42;
    let nonce_2 = nonce_1.nonce(&bytes[0..248], 4000).unwrap();

    assert_eq!(nonce_1, nonce_2);
}