Skip to main content

compute_sha512t24u

Function compute_sha512t24u 

Source
pub fn compute_sha512t24u(sequence: &[u8]) -> String
Expand description

Compute the GA4GH sha512t24u digest for a sequence.

Algorithm: SHA-512 the sequence bytes, truncate to the first 24 bytes, then base64url-encode without padding, producing a 32-character string.

The input sequence should already be uppercased.

ยงExamples

use ref_solver::utils::validation::compute_sha512t24u;

let digest = compute_sha512t24u(b"ACGT");
assert_eq!(digest.len(), 32);