hash

Function hash 

Source
pub fn hash(
    data: &str,
    algorithm: HashAlgorithm,
    digest: DigestFormat,
) -> Result<String>
Expand description

Computes a cryptographic hash (one-way, keyless).

§Arguments

  • data - Data to hash
  • algorithm - Hash algorithm to use
  • digest - Output encoding format

§Returns

Encoded hash string.

§Examples

use ccxt_core::auth::{hash, HashAlgorithm, DigestFormat};

let hashed = hash("test", HashAlgorithm::Sha256, DigestFormat::Hex).unwrap();