Crypt.NaCl.Class
- Package
- purescript-tweetnacl
- Repository
- AlexaDeWit/purescript-tweetnacl
#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
#Uint8ArrayReadable Source
class Uint8ArrayReadable a where
Denotes a class of NaCl types which are convertable from Uint8Array
s.
Instances of this typeclass will unsafeCoerce
their values from Uint8Array
because we know that everything in/out of the underlying library are,
in fact, Uint8Array
s.
Members
fromUint8Array :: Uint8Array -> a
Instances
Uint8ArrayReadable HashSha512
Uint8ArrayReadable Nonce
Uint8ArrayReadable Message
Uint8ArrayReadable Box
Uint8ArrayReadable BoxPublicKey
Uint8ArrayReadable BoxSecretKey
Uint8ArrayReadable SecretBox
Uint8ArrayReadable SecretBoxKey
Uint8ArrayReadable SignPublicKey
Uint8ArrayReadable SignSecretKey
Uint8ArrayReadable SignedMessage
#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