VirtualC64
v5.0 beta
Commodore 64 Emulator
Loading...
Searching...
No Matches
Checksum.h
1
// -----------------------------------------------------------------------------
2
// This file is part of VirtualC64
3
//
4
// Copyright (C) Dirk W. Hoffmann. www.dirkwhoffmann.de
5
// This FILE is dual-licensed. You are free to choose between:
6
//
7
// - The GNU General Public License v3 (or any later version)
8
// - The Mozilla Public License v2
9
//
10
// SPDX-License-Identifier: GPL-3.0-or-later OR MPL-2.0
11
// -----------------------------------------------------------------------------
12
13
#pragma once
14
15
#include "Types.h"
16
17
namespace
vc64::util {
18
19
// Returns the FNV-1a seed value
20
inline
u32 fnvInit32() {
return
0x811c9dc5; }
21
inline
u64 fnvInit64() {
return
0xcbf29ce484222325; }
22
23
// Performs a single iteration of the FNV-1a hash algorithm
24
u32 fnvIt32(u32 prv, u32 val);
25
u64 fnvIt64(u64 prv, u64 val);
26
27
// Computes a FNV-1a checksum for a given buffer
28
u32 fnv32(
const
u8 *addr, isize size);
29
u64 fnv64(
const
u8 *addr, isize size);
30
31
// Computes a CRC checksum for a given buffer
32
u16 crc16(
const
u8 *addr, isize size);
33
u32 crc32(
const
u8 *addr, isize size);
34
u32 crc32forByte(u32 r);
35
36
}
Emulator
Utilities
Checksum.h
Generated by
1.10.0