SodiumPointer<T extends NativeType> class

A C-Pointer wrapper that uses the memory utilities of libsodium.

See https://libsodium.gitbook.io/doc/memory_management

Implemented types
Available Extensions

Constructors

SodiumPointer.alloc(LibSodiumFFI sodium, {int count = 1, MemoryProtection memoryProtection = MemoryProtection.readWrite, bool zeroMemory = false})
Allocates new memory using the libsodium APIs.
factory
SodiumPointer.raw(LibSodiumFFI sodium, Pointer<T> ptr, int count)
Constructs the pointer from the libsodium API, the raw ptr and the element count.

Properties

byteLength int
The total number of bytes this pointer is long
no setter
count int
The number of elements this pointer is pointing to
final
elementSize int
The number of bytes a single element of T is wide.
no setter
hashCode int
The hash code for this object.
no setterinherited
locked bool
Controls whether the pointer is locked in memory or not.
getter/setter pair
memoryProtection MemoryProtection
Controls the memory protection level of the allocated memory
getter/setter pair
ptr Pointer<T>
The underlying native C pointer
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
sodium → LibSodiumFFI
libsodium bindings used to access the C API
final

Methods

asListView<TNum extends num>() List<TNum>
Returns a dart list view on the pointer.
dispose() → void
Disposes the pointer and frees the allocated memory.
fill<TNum extends num>(List<TNum> data, {int offset = 0}) → void
Fills an area of the memory with the given data.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
viewAt(int offset, [int? length]) SodiumPointer<T>
Returns a view of a subset of the memory the pointer is pointing to.
zeroMemory() → void
Provides sodium_memzero

Operators

operator ==(Object other) bool
The equality operator.
inherited