stringToIndex

1function stringToIndex(phrase): bigint;

Defined in: aa-sdk/core/src/utils/bigint.ts:117

Useful if you want to use a string, such as a user’s email address, as salt to generate a unique SmartAccount per user.

example:

const salt = stringToIndex("[email protected]");
export const account = new SimpleSmartContractAccount({
index: salt,
// other args omitted...
});

Parameters

ParameterTypeDescription

phrase

string

any string value.

Returns

bigint

the bigint value of the hashed string