Types

Functions

fn calcSize(params: anytype) usize

Compute the number of bytes required to serialize params

fn deserialize(comptime HashResult: type, str: []const u8) Error!HashResult

Deserialize a PHC-formatted string into a structure HashResult.

Deserialize a PHC-formatted string into a structure HashResult.

Required field in the HashResult structure:

  • alg_id: algorithm identifier Optional, special fields:
  • alg_version: algorithm version (unsigned integer)
  • salt: salt
  • hash: output of the hash function

Other fields will also be deserialized from the function parameters section.

fn serialize(params: anytype, str: []u8) Error![]const u8

Serialize parameters into a PHC string.

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.

Values

Error
type