Function serialize [src]
Serialize parameters into a PHC string.
Required field for params:
alg_id: algorithm identifier
Optional, special fields:
alg_version: algorithm version (unsigned integer)
salt: salt
hash: output of the hash function
params can also include any additional parameters.
Prototype
pub fn serialize(params: anytype, str: []u8) Error![]const u8
Parameters
str: []u8
Possible Errors
Source
pub fn serialize(params: anytype, str: []u8) Error![]const u8 {
var w: Writer = .fixed(str);
serializeTo(params, &w) catch return error.NoSpaceLeft;
return w.buffered();
}