AIJsonUtilities.HashDataToString Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Serializes the supplied values and computes a string hash of the resulting JSON.
public static string HashDataToString(ReadOnlySpan<object?> values, System.Text.Json.JsonSerializerOptions? serializerOptions = default);
static member HashDataToString : ReadOnlySpan<obj> * System.Text.Json.JsonSerializerOptions -> string
Public Function HashDataToString (values As ReadOnlySpan(Of Object), Optional serializerOptions As JsonSerializerOptions = Nothing) As String
Parameters
- values
- ReadOnlySpan<Object>
The data to serialize and from which a hash should be computed.
- serializerOptions
- JsonSerializerOptions
The JsonSerializerOptions to use for serializing the values.
If null
, DefaultOptions will be used.
Returns
A string that will be used as a cache key.
Remarks
The resulting hash may be used for purposes like caching. However, while the generated hash is deterministic for the same inputs, it is not guaranteed to be stable across releases of the library, as exactly how the hash is computed may change from version to version.