Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
pulp::timeline::ContentHash Class Reference

Durable SHA-256 identity for sealed media bytes. More...

#include <assets.hpp>

Public Member Functions

constexpr ContentHash () noexcept=default
std::string to_hex () const
 Returns the lowercase 64-digit encoding; invalid hashes encode as 64 zeroes.
constexpr bool valid () const noexcept
 Returns whether this value was constructed from a complete digest.
constexpr const std::array< std::uint8_t, 32 > & bytes () const noexcept
 Borrows the 32 digest bytes for the lifetime of this value.
constexpr auto operator<=> (const ContentHash &) const =default

Static Public Member Functions

static std::optional< ContentHash > from_hex (std::string_view hex) noexcept
 Decodes exactly 64 lowercase hexadecimal digits, or returns null on malformed input.

Detailed Description

Durable SHA-256 identity for sealed media bytes.

Paths and package locations are resolution hints and never participate in equality. A default-constructed value is invalid.

Constructor & Destructor Documentation

◆ ContentHash()

pulp::timeline::ContentHash::ContentHash ( )
constexprdefaultnoexcept

Member Function Documentation

◆ bytes()

const std::array< std::uint8_t, 32 > & pulp::timeline::ContentHash::bytes ( ) const
inlineconstexprnoexcept

Borrows the 32 digest bytes for the lifetime of this value.

◆ from_hex()

std::optional< ContentHash > pulp::timeline::ContentHash::from_hex ( std::string_view hex)
staticnoexcept

Decodes exactly 64 lowercase hexadecimal digits, or returns null on malformed input.

◆ operator<=>()

auto pulp::timeline::ContentHash::operator<=> ( const ContentHash & ) const
constexprdefault

◆ to_hex()

std::string pulp::timeline::ContentHash::to_hex ( ) const

Returns the lowercase 64-digit encoding; invalid hashes encode as 64 zeroes.

◆ valid()

bool pulp::timeline::ContentHash::valid ( ) const
inlineconstexprnoexcept

Returns whether this value was constructed from a complete digest.


The documentation for this class was generated from the following file:
  • /home/runner/work/pulp/pulp/core/timeline/include/pulp/timeline/assets.hpp