Loading...
Searching...
No Matches
juce::MD5 Class Reference

## Detailed Description

MD5 checksum class.

Create one of these with a block of source data or a stream, and it calculates the MD5 checksum of that data.

You can then retrieve this checksum as a 16-byte block, or as a hex string.

See also
  SHA256

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

- juce_cryptography/hashing/juce_MD5.h

## Public Member Functions

| MD5 ()
| Creates a null MD5 object.
| MD5 (const MD5 &)
| Creates a copy of another MD5.
MD5 & | operator= (const MD5 &)
| Copies another MD5.
| MD5 (const MemoryBlock &) noexcept
| Creates a checksum for a block of binary data.
| MD5 (const void *data, size_t numBytes) noexcept
| Creates a checksum for a block of binary data.
| MD5 (InputStream &input, int64 numBytesToRead=-1)
| Creates a checksum for the input from a stream.
| MD5 (const File &)
| Creates a checksum for the contents of a file.
| MD5 (CharPointer_UTF8 utf8Text) noexcept
| Creates a checksum of the characters in a UTF-8 buffer.
| ~MD5 ()
| Destructor.
MemoryBlock | getRawChecksumData () const
| Returns the checksum as a 16-byte block of data.
const uint8 * | getChecksumDataArray () const noexcept
| Returns a pointer to the 16-byte array of result data.
String | toHexString () const
| Returns the checksum as a 32-digit hex string.
bool | operator== (const MD5 &) const noexcept
bool | operator!= (const MD5 &) const noexcept

## Static Public Member Functions

static MD5 | fromUTF32 (StringRef)
| Creates an MD5 from a little-endian UTF-32 encoded string.

## Constructors and Destructors

## MD5() [1/7]

juce::MD5::MD5 | ( |  | ) |

Creates a null MD5 object.

Referenced by fromUTF32(), MD5(), operator!=(), operator=(), and operator==().

## MD5() [2/7]

juce::MD5::MD5 | ( | const MD5 & |  | ) |

Creates a copy of another MD5.

References MD5().

## MD5() [3/7]

juce::MD5::MD5 | ( | const MemoryBlock & |  | ) |

explicit noexcept

Creates a checksum for a block of binary data.

## MD5() [4/7]

juce::MD5::MD5 | ( | const void * | data,
|  | size_t | numBytes )

noexcept

Creates a checksum for a block of binary data.

## MD5() [5/7]

juce::MD5::MD5 | ( | InputStream & | input,
|  | int64 | numBytesToRead = -1 )

Creates a checksum for the input from a stream.

This will read up to the given number of bytes from the stream, and produce the checksum of that. If the number of bytes to read is negative, it'll read until the stream is exhausted.

## MD5() [6/7]

juce::MD5::MD5 | ( | const File & |  | ) |

explicit

Creates a checksum for the contents of a file.

## MD5() [7/7]

juce::MD5::MD5 | ( | CharPointer_UTF8 | utf8Text | ) |

explicit noexcept

Creates a checksum of the characters in a UTF-8 buffer.

E.g.

MD5 checksum (myString.toUTF8());
juce::MD5::MD5
MD5()
Creates a null MD5 object.

## ~MD5()

juce::MD5::~MD5 | ( |  | ) |

Destructor.

## Member Functions

## operator=()

MD5 & juce::MD5::operator= | ( | const MD5 & |  | ) |

Copies another MD5.

References MD5().

## getRawChecksumData()

MemoryBlock juce::MD5::getRawChecksumData | ( |  | ) | const

Returns the checksum as a 16-byte block of data.

## getChecksumDataArray()

const uint8 * juce::MD5::getChecksumDataArray | ( |  | ) | const

inline noexcept

Returns a pointer to the 16-byte array of result data.

## toHexString()

String juce::MD5::toHexString | ( |  | ) | const

Returns the checksum as a 32-digit hex string.

## fromUTF32()

MD5 juce::MD5::fromUTF32 | ( | StringRef |  | ) |

static

Creates an MD5 from a little-endian UTF-32 encoded string.

Note that this method is provided for backwards-compatibility with the old version of this class, which had a constructor that took a string and performed this operation on it. In new code, you shouldn't use this, and are recommended to use the constructor that takes a CharPointer_UTF8 instead.

References MD5().

## operator==()

bool juce::MD5::operator== | ( | const MD5 & |  | ) | const

noexcept

References MD5().

## operator!=()

bool juce::MD5::operator!= | ( | const MD5 & |  | ) | const

noexcept

References MD5().

### Purchase

Get JUCE

### Discover

What's New in JUCE Features

### Learn

Documentaion Tutorials Made with JUCE Resources

### Support

JUCE Forum Newsletter Archive

### About

Contact Us JUCE Legal JUCE Licensing FAQ

### Events

Audio Developer Conference
© Raw Material Software Limited