toSodiumPointer method

SodiumPointer<Char> toSodiumPointer(
  1. LibSodiumFFI sodium, {
  2. int? memoryWidth,
  3. bool zeroTerminated = false,
  4. MemoryProtection memoryProtection = MemoryProtection.readWrite,
})

Converts the string to a SodiumPointer<Int8>

This simply combines StringX.toCharArray with Int8SodiumList.toSodiumPointer.

Implementation

SodiumPointer<Char> toSodiumPointer(
  LibSodiumFFI sodium, {
  int? memoryWidth,
  bool zeroTerminated = false,
  MemoryProtection memoryProtection = MemoryProtection.readWrite,
}) =>
    toCharArray(
      memoryWidth: memoryWidth,
      zeroTerminated: zeroTerminated,
    ).toSodiumPointer(
      sodium,
      memoryProtection: memoryProtection,
    );