Class TreeHasher<K, V>

Tree Hasher

Type Parameters

  • K

  • V

Hierarchy

  • TreeHasher

Constructors

  • Creates an instance of TreeHasher.

    Memberof

    TreeHasher

    Type Parameters

    • K

    • V

    Parameters

    • Optional hasher: Hasher = Poseidon.hash
    • Optional keyType: Provable<K>
    • Optional valueType: Provable<V>

    Returns TreeHasher<K, V>

Properties

hasher: Hasher
keyType?: Provable<K>
valueType?: Provable<V>

Methods

  • Parameters

    • path: Field
    • leafData: Field

    Returns {
        hash: Field;
        value: Field[];
    }

    • hash: Field
    • value: Field[]
  • Parameters

    • leftData: Field
    • rightData: Field

    Returns {
        hash: Field;
        value: Field[];
    }

    • hash: Field
    • value: Field[]
  • Parameters

    • data: Field[]

    Returns {
        leaf: Field;
        path: Field;
    }

    • leaf: Field
    • path: Field
  • Parameters

    • data: Field[]

    Returns {
        leftNode: Field;
        rightNode: Field;
    }

    • leftNode: Field
    • rightNode: Field
  • Tree Hasher based on Poseidon.hash

    Static

    Returns

    {TreeHasher<K, V>}

    Memberof

    TreeHasher

    Type Parameters

    • K

    • V

    Parameters

    • Optional keyType: Provable<K>
    • Optional valueType: Provable<V>

    Returns TreeHasher<K, V>

Generated using TypeDoc