Crypt.NaCl.Class
- Package
- purescript-crypt-nacl
- Repository
- throughnothing/purescript-crypt-nacl
#Uint8ArrayAble Source
class Uint8ArrayAble a where
Denotes a class of NaCl types which are convertable to Uint8Array
s.
Instances of this typeclass will unsafeCoerce
their values to Uint8Array
because we know that everything in/out of the underlying library are,
in fact, Uint8Array
s.
Members
toUint8Array :: a -> Uint8Array
Instances
#Utf8Decodable Source
class Utf8Decodable a where
This type class denotes types that can be decoded to a UTF8 String.
The toString
function returns Either Error String
to handle errors
during the decode. We will generally unsafeCoerce
because we know the
underlying type is already of Uint8Array from the wrapped library.
Members
Instances
#Utf8Encodable Source
class Utf8Encodable a where
This type class denotes types that can be encoded to a UTF8 String.
The fromString
function returns the type of the type class instance.
We will generally unsafeCoerce
from the Uint8Array
type to the
NaCl type we want because all underlying types are Uint8Array
Members
fromString :: String -> a