mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-04-25 19:02:13 +00:00
Add a method to create a pre shared key when you already have the raw bytes (#1570)
This commit is contained in:
parent
06721128f1
commit
a83654ca4c
@ -55,6 +55,11 @@ const FINGERPRINT_SIZE: usize = 16;
|
|||||||
pub struct PreSharedKey([u8; KEY_SIZE]);
|
pub struct PreSharedKey([u8; KEY_SIZE]);
|
||||||
|
|
||||||
impl PreSharedKey {
|
impl PreSharedKey {
|
||||||
|
/// Create a new pre shared key from raw bytes
|
||||||
|
pub fn new(data: [u8; KEY_SIZE]) -> Self {
|
||||||
|
Self(data)
|
||||||
|
}
|
||||||
|
|
||||||
/// Compute PreSharedKey fingerprint identical to the go-libp2p fingerprint.
|
/// Compute PreSharedKey fingerprint identical to the go-libp2p fingerprint.
|
||||||
/// The computation of the fingerprint is not specified in the spec.
|
/// The computation of the fingerprint is not specified in the spec.
|
||||||
///
|
///
|
||||||
|
Loading…
x
Reference in New Issue
Block a user