hashValue: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
(Example 2)
m (Text replacement - "\[ *(https?:\/\/[^ = ]+) +([^= ]+) *\]" to "{{Link|$1|$2}}")
 
(2 intermediate revisions by 2 users not shown)
Line 6: Line 6:
|gr1= HashMap
|gr1= HashMap


|descr= Processes provided ''value''<nowiki/>'s hash.
|descr= Processes provided ''value''<nowiki/>'s hash, and encodes it using {{Link|https://en.wikipedia.org/wiki/Base64|Base64}}. The hash algorithm is {{Link|https://en.wikipedia.org/wiki/Fowler%E2%80%93Noll%E2%80%93Vo_hash_function|FNV-1A 64bit}}.
{{Feature|informative|A hash value remains the same between game restarts but for [[Object]] and [[Group]] type, their hash being based on their [[netId]].}}
{{Feature|informative|A hash value remains the same between game restarts but for [[Object]] and [[Group]] type, their hash being based on their [[netId]].}}


Line 15: Line 15:
|r1= [[String]] - base64-encoded 64 bits hash
|r1= [[String]] - base64-encoded 64 bits hash


|x1= <code>[[private]] _valueHash = [[hashValue]] "Hello There";</code>
|x1= <sqf>private _valueHash = hashValue "Hello There";</sqf>


|x2= <code>[[private]] _isCorrectPW = [[hashValue]] _enteredPassword == "eWkXUUqiinE";</code>
|x2= <sqf>private _isCorrectPW = hashValue _enteredPassword == "eWkXUUqiinE";</sqf>


|seealso= [[createHashMap]] [[values]]
|seealso= [[createHashMap]] [[values]]
}}
}}

Latest revision as of 15:11, 28 April 2023

Hover & click on the images for description

Description

Description:
Processes provided value's hash, and encodes it using Base64. The hash algorithm is FNV-1A 64bit.
A hash value remains the same between game restarts but for Object and Group type, their hash being based on their netId.
Groups:
HashMap

Syntax

Syntax:
hashValue value
Parameters:
value: Array, Boolean, Code, Config, Group, Namespace, NaN, Number, Object, Side or String
Return Value:
String - base64-encoded 64 bits hash

Examples

Example 1:
private _valueHash = hashValue "Hello There";
Example 2:
private _isCorrectPW = hashValue _enteredPassword == "eWkXUUqiinE";

Additional Information

See also:
createHashMap values

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note