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 (span< const uint8_t > data)
 Incrementally calculate the hash value. More...
 
Sha1Sum digest ()
 Get the final hash. More...
 

Static Public Member Functions

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

Detailed Description

Helper class to perform a sha1 calculation.

Basic usage:

Definition at line 80 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 ( 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 359 of file utils/sha1.cc.

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

◆ update()

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

Incrementally calculate the hash value.

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

References span< ElementType, Extent >::data(), and span< ElementType, Extent >::size().

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


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