init2 static method

Future<SodiumSumo> init2(
  1. DynamicLibraryFactory getLibsodium
)

Creates a SodiumSumo instance for the loaded libsodium returned by the callback.

The getLibsodium parameter must be a factory method that returns a loaded sumo variant of [lib]sodium.[so|dll|dylib|a|lib|js]- depending on your platform. Please refer to the README for more details on loading the library.

Unlike the init method, this one enables the use of SodiumSumo.runIsolated. Use it preferably.

Implementation

static Future<SodiumSumo> init2(
  DynamicLibraryFactory getLibsodium,
) =>
    initFromSodiumFFI2(
      () async => LibSodiumFFI(await getLibsodium()),
    );