• Converts a HashTypeLike value to a HashType.

    Parameters

    • val: HashTypeLike

      The value to convert, which can be a string, number, or bigint.

    Returns HashType

    The corresponding HashType.

    Will throw an error if the input value is not a valid hash type.

    const hashType = hashTypeFrom(1); // Outputs "data"
    const hashType = hashTypeFrom("type"); // Outputs "type"