hashPoseidonString function

String hashPoseidonString(
  1. String claimData
)

Generates a Poseidon Hash of the given UTF8 string and returns it encoded in Base64

Implementation

String hashPoseidonString(String claimData) {
  if (bridge.nativeDvote == null)
    throw Exception("The library is not initialized");
  final claimDataPtr = Utf8.toUtf8(claimData);

  // The actual native call
  final resultPtr = bridge.digestStringClaim(claimDataPtr);

  return bridge.handleResultStringPointer(resultPtr);
}