- Preparing search index...
- The search index is not available
snarky-smt
Constructors
constructor
- new TreeHasher<K, V>(hasher??: Hasher, keyType?: Provable<K>, valueType?: Provable<V>): TreeHasher<K, V>
-
Parameters
-
Optional
hasher: Hasher = Poseidon.hash
-
Optional
keyType: Provable<K>
-
Optional
valueType: Provable<V>
Properties
Private
Optional
keyType
keyType?: Provable<K>
Private
Optional
valueType
valueType?: Provable<V>
Methods
digestLeaf
- digestLeaf(path: Field, leafData: Field): {
hash: Field;
value: Field[];
}
-
Parameters
-
path: Field
-
leafData: Field
Returns {
hash: Field;
value: Field[];
}
-
hash: Field
-
value: Field[]
digestNode
- digestNode(leftData: Field, rightData: Field): {
hash: Field;
value: Field[];
}
-
Parameters
-
leftData: Field
-
rightData: Field
Returns {
hash: Field;
value: Field[];
}
-
hash: Field
-
value: Field[]
digestValue
- digestValue(value: V): Field
-
Returns Field
emptyData
- emptyData(): Field[]
-
Returns Field[]
isEmptyData
- isEmptyData(data: Field[]): boolean
-
Returns boolean
isEmptyDataInCircuit
- isEmptyDataInCircuit(data: Field[]): Bool
-
Returns Bool
isLeaf
- isLeaf(data: Field[]): boolean
-
Returns boolean
parseLeaf
- parseLeaf(data: Field[]): {
leaf: Field;
path: Field;
}
-
Returns {
leaf: Field;
path: Field;
}
parseNode
- parseNode(data: Field[]): {
leftNode: Field;
rightNode: Field;
}
-
Returns {
leftNode: Field;
rightNode: Field;
}
-
leftNode: Field
-
rightNode: Field
path
- path(k: K): Field
-
Returns Field
Static
poseidon
- poseidon<K, V>(keyType?: Provable<K>, valueType?: Provable<V>): TreeHasher<K, V>
-
Parameters
-
Optional
keyType: Provable<K>
-
Optional
valueType: Provable<V>
Tree Hasher