1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
// Copyright 2020-2022 The Defold Foundation
// Copyright 2014-2020 King
// Copyright 2009-2014 Ragnar Svensson, Christian Murray
// Licensed under the Defold License version 1.0 (the "License"); you may not use
// this file except in compliance with the License.
//
// You may obtain a copy of the License, together with FAQs at
// https://www.defold.com/license
//
// Unless required by applicable law or agreed to in writing, software distributed
// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
// CONDITIONS OF ANY KIND, either express or implied. See the License for the
// specific language governing permissions and limitations under the License.
/*# SDK Hash API documentation
* Hash functions.
*
* @document
* @name Hash
* @namespace dmHash
* @path engine/dlib/src/dmsdk/dlib/hash.h
*/
/*# dmhash_t type definition
*
* ```cpp
* typedef uint64_t dmhash_t
* ```
*
* @typedef
* @name dmhash_t
*
*/
typedef uint64_t dmhash_t;
extern "C" __cplusplus
} // extern "C"
/*#
* Hash state used for 32-bit incremental hashing
* @struct
* @name HashState32
*/
;
/*#
* Hash state used for 64-bit incremental hashing
* @struct
* @name HashState64
*/
;
/*#
* Initialize hash-state for 32-bit incremental hashing
* @name dmHashInit32
* @param hash_state [type: HashState32*] Hash state
* @param reverse_hash [type: bool] true to enable reverse hashing of buffers up to ::DMHASH_MAX_REVERSE_LENGTH
*/
DM_DLLEXPORT void ;
/*#
* Clone 32-bit incremental hash state
* @name dmHashClone32
* @param hash_state [type: HashState32*] Hash state
* @param source_hash_state [type: HashState32*] Source hash state
* @param reverse_hash [type: bool] true to enable reverse hashing of buffers up to ::DMHASH_MAX_REVERSE_LENGTH. Ignored if source state reverse hashing is disabled.
*/
DM_DLLEXPORT void ;
/*#
* Incremental hashing
* @name dmHashUpdateBuffer32
* @param hash_state [type: HashState32*] Hash state
* @param buffer [type:const void*] Buffer
* @param buffer_len [type:uint32_t] Length of buffer
*/
DM_DLLEXPORT void ;
/*#
* Finalize incremental hashing and release associated resources
* @name dmHashFinal32
* @param hash_state [type: HashState32*] Hash state
* @return hash [type: uint32_t] the hash value
*/
DM_DLLEXPORT uint32_t ;
/*#
* Release incremental hashing resources
* Used to release assocciated resources for intermediate incremental hash states.
* @name dmHashRelease32
* @param hash_state [type: HashState32*] Hash state
*/
DM_DLLEXPORT void ;
/*#
* Initialize hash-state for 64-bit incremental hashing
* @name dmHashInit64
* @param hash_state [type: HashState64*] Hash state
* @param reverse_hash true to enable reverse hashing of buffers up to ::DMHASH_MAX_REVERSE_LENGTH
*/
DM_DLLEXPORT void ;
/*#
* Clone 64-bit incremental hash state
* @name dmHashClone64
* @param hash_state [type: HashState64*] Hash state
* @param source_hash_state [type: HashState64*] Source hash state
* @param reverse_hash true [type: bool] to enable reverse hashing of buffers up to ::DMHASH_MAX_REVERSE_LENGTH. Ignored if source state reverse hashing is disabled.
*/
DM_DLLEXPORT void ;
/*#
* Incremental hashing
* @name dmHashUpdateBuffer64
* @param hash_state [type: HashState64*] Hash state
* @param buffer [type:const void*] Buffer
* @param buffer_len [type:uint32_t] Length of buffer
*/
DM_DLLEXPORT void ;
/*#
* Finalize incremental hashing and release associated resources
* @name dmHashFinal64
* @param hash_state [type: HashState64*] Hash state
* @return hash [type:uint64_t] The hash value
*/
DM_DLLEXPORT uint64_t ;
/*#
* Release incremental hashing resources
* Used to release assocciated resources for intermediate incremental hash states.
* @name dmHashRelease64
* @param hash_state [type: HashState64*] Hash state
*/
DM_DLLEXPORT void ;
// __cplusplus
// DMSDK_HASH_H