#include <opennurbs_sha1.h>
|
static ON_SHA1_Hash | BufferContentHash (const void *buffer, size_t sizeof_buffer) |
|
static int | Compare (const ON_SHA1_Hash &a, const ON_SHA1_Hash &b) |
|
static ON_SHA1_Hash | FileContentHash (const wchar_t *file_name, ON__UINT64 &sizeof_file) |
|
static ON_SHA1_Hash | FileContentHash (const char *file_name, ON__UINT64 &sizeof_file) |
|
static ON_SHA1_Hash | FileContentHash (FILE *file, ON__UINT64 &sizeof_file) |
|
static ON_SHA1_Hash | FileSystemPathHash (const wchar_t *path) |
| Return a hash of the file system path that is independent of the size of wchar_t, constant across platforms, and constant across varations in the way the path is formatted. More...
|
|
static ON_SHA1_Hash | FileSystemPathHash (const char *path) |
|
static ON_SHA1_Hash | FileSystemPathHash (const wchar_t *path, bool bIgnoreCase) |
|
static ON_SHA1_Hash | FileSystemPathHash (const char *path, bool bIgnoreCase) |
|
static ON_SHA1_Hash | StringHash (const ON_wString &str, ON__UINT64 &byte_count) |
|
static ON_SHA1_Hash | StringHash (const wchar_t *str, size_t str_length, ON__UINT64 &byte_count) |
|
static ON_SHA1_Hash | StringHash (const wchar_t *null_terminated_string) |
|
static ON_SHA1_Hash | StringHash (const ON_String &str, ON__UINT64 &byte_count) |
|
static ON_SHA1_Hash | StringHash (const char *str, size_t str_length, ON__UINT64 &byte_count) |
|
static ON_SHA1_Hash | StringHash (const char *null_terminated_string) |
|
◆ ON_SHA1_Hash() [1/2]
ON_SHA1_Hash::ON_SHA1_Hash |
( |
| ) |
|
The default constructor creates a zero digest sha1 hash.
◆ ~ON_SHA1_Hash()
ON_SHA1_Hash::~ON_SHA1_Hash |
( |
| ) |
|
|
default |
◆ ON_SHA1_Hash() [2/2]
◆ BufferContentHash()
static ON_SHA1_Hash ON_SHA1_Hash::BufferContentHash |
( |
const void * |
buffer, |
|
|
size_t |
sizeof_buffer |
|
) |
| |
|
static |
- Parameters
-
buffer | [in] |
sizeof_buffer | [in] number of bytes in buffer |
- Returns
- SHA1-1 hash of the buffer.
◆ Compare()
◆ Dump()
void ON_SHA1_Hash::Dump |
( |
class ON_TextLog & |
text_log | ) |
const |
◆ FileContentHash() [1/3]
static ON_SHA1_Hash ON_SHA1_Hash::FileContentHash |
( |
const wchar_t * |
file_name, |
|
|
ON__UINT64 & |
sizeof_file |
|
) |
| |
|
static |
- Parameters
-
file_name | [in] Name of file |
sizeof_file | [out] number of bytes in file |
- Returns
- SHA1-1 hash of the buffer.
◆ FileContentHash() [2/3]
static ON_SHA1_Hash ON_SHA1_Hash::FileContentHash |
( |
const char * |
file_name, |
|
|
ON__UINT64 & |
sizeof_file |
|
) |
| |
|
static |
◆ FileContentHash() [3/3]
static ON_SHA1_Hash ON_SHA1_Hash::FileContentHash |
( |
FILE * |
file, |
|
|
ON__UINT64 & |
sizeof_file |
|
) |
| |
|
static |
- Parameters
-
file | [in] File stream from ON_FileStream::Open(...,L"rb"); |
sizeof_file | [out] number of bytes in file |
- Returns
- SHA1-1 hash of the file stream from the current offset to the end of the file.
◆ FileSystemPathHash() [1/4]
static ON_SHA1_Hash ON_SHA1_Hash::FileSystemPathHash |
( |
const wchar_t * |
path | ) |
|
|
static |
Return a hash of the file system path that is independent of the size of wchar_t, constant across platforms, and constant across varations in the way the path is formatted.
- Parameters
-
path | [in] File system path to a directory or file. |
- Returns
SHA1-1 hash of the buffer.
This function uses the value of ON_FileSystemPath::PlatformPathIgnoreCase() to determine if case should be ignored. Use the version with a bIgnoreCase parameter if you want to explicitly control this decision.
/x/y/z/name.ext
\x\y\z\name.ext
/x
/x/y/a/b/c/../../../z/name.ext
/X/Y/Z/NAME.EXT (When ON_ComparePathIgnoreCase() is true)
◆ FileSystemPathHash() [2/4]
static ON_SHA1_Hash ON_SHA1_Hash::FileSystemPathHash |
( |
const char * |
path | ) |
|
|
static |
◆ FileSystemPathHash() [3/4]
static ON_SHA1_Hash ON_SHA1_Hash::FileSystemPathHash |
( |
const wchar_t * |
path, |
|
|
bool |
bIgnoreCase |
|
) |
| |
|
static |
◆ FileSystemPathHash() [4/4]
static ON_SHA1_Hash ON_SHA1_Hash::FileSystemPathHash |
( |
const char * |
path, |
|
|
bool |
bIgnoreCase |
|
) |
| |
|
static |
◆ IsEmptyContentHash()
bool ON_SHA1_Hash::IsEmptyContentHash |
( |
| ) |
const |
◆ IsZeroDigentOrEmptyContentHash()
bool ON_SHA1_Hash::IsZeroDigentOrEmptyContentHash |
( |
| ) |
const |
◆ IsZeroDigest()
bool ON_SHA1_Hash::IsZeroDigest |
( |
| ) |
const |
◆ operator=()
◆ Read()
◆ StringHash() [1/6]
- Parameters
-
str | [in] string |
byte_count | [out] number of bytes in UTF-8 encoding of the string. |
- Returns
- SHA1-1 hash of the UTF-8 encoding of the string. (Platforms and endian independent.)
◆ StringHash() [2/6]
static ON_SHA1_Hash ON_SHA1_Hash::StringHash |
( |
const wchar_t * |
str, |
|
|
size_t |
str_length, |
|
|
ON__UINT64 & |
byte_count |
|
) |
| |
|
static |
◆ StringHash() [3/6]
static ON_SHA1_Hash ON_SHA1_Hash::StringHash |
( |
const wchar_t * |
null_terminated_string | ) |
|
|
static |
◆ StringHash() [4/6]
- Parameters
-
str | [in] |
byte_count | [out] number of bytes in the string. |
- Returns
- SHA1-1 hash of the UTF-8 encoding of the string. (Platforms and endian independent.)
◆ StringHash() [5/6]
static ON_SHA1_Hash ON_SHA1_Hash::StringHash |
( |
const char * |
str, |
|
|
size_t |
str_length, |
|
|
ON__UINT64 & |
byte_count |
|
) |
| |
|
static |
◆ StringHash() [6/6]
static ON_SHA1_Hash ON_SHA1_Hash::StringHash |
( |
const char * |
null_terminated_string | ) |
|
|
static |
◆ ToString()
const ON_wString ON_SHA1_Hash::ToString |
( |
bool |
bUpperCaseHexadecimalDigits | ) |
const |
- Parameters
-
bUpperCaseHexadecimalDigits | [in] |
false | use 0-9, a-f |
true | use 0-9, A-F |
- Returns
- The SHA-1 hash value as a 40 hexadecimal digits. The first digit in the string is the hexadecimal value of m_digest[0].
◆ ToUTF8String()
const ON_String ON_SHA1_Hash::ToUTF8String |
( |
bool |
bUpperCaseHexadecimalDigits | ) |
const |
- Parameters
-
bUpperCaseHexadecimalDigits | [in] |
false | use 0-9, a-f |
true | use 0-9, A-F |
- Returns
- The SHA-1 hash value as a 40 hexadecimal digits. The first digit in the string is the hexadecimal value of m_digest[0].
◆ Write()
◆ EmptyContentHash
◆ m_digest
ON__UINT8 ON_SHA1_Hash::m_digest[20] |
◆ ZeroDigest