openMSX
Public Member Functions | Static Public Member Functions | List of all members
openmsx::SHA1 Class Reference

Helper class to perform a sha1 calculation. More...

#include <sha1.hh>

Public Member Functions

 SHA1 ()
 
void update (std::span< const uint8_t > data)
 Incrementally calculate the hash value.
 
Sha1Sum digest ()
 Get the final hash.
 

Static Public Member Functions

static Sha1Sum calc (std::span< const uint8_t > data)
 Easier to use interface, if you can pass all data in one go.
 

Detailed Description

Helper class to perform a sha1 calculation.

Basic usage:

Definition at line 79 of file sha1.hh.

Constructor & Destructor Documentation

◆ SHA1()

openmsx::SHA1::SHA1 ( )

Definition at line 254 of file utils/sha1.cc.

Member Function Documentation

◆ calc()

Sha1Sum openmsx::SHA1::calc ( std::span< const uint8_t >  data)
static

◆ digest()

Sha1Sum openmsx::SHA1::digest ( )

Get the final hash.

After this method is called, calls to update() are invalid.

Definition at line 355 of file utils/sha1.cc.

Referenced by calc(), openmsx::SectorAccessibleDisk::getSha1SumImpl(), TEST_CASE(), and TEST_CASE().

◆ update()

void openmsx::SHA1::update ( std::span< const uint8_t >  data)

Incrementally calculate the hash value.

Definition at line 313 of file utils/sha1.cc.

References ranges::copy(), and subspan().

Referenced by calc(), openmsx::SectorAccessibleDisk::getSha1SumImpl(), TEST_CASE(), and TEST_CASE().


The documentation for this class was generated from the following files: