sodium.cr/src/cox/key.cr
Didactic Drunk a0f15b7657 Switch .to_unsafe to .to_slice
Remove use of .pointer
2019-06-27 17:42:49 -07:00

15 lines
239 B
Crystal

module Cox
abstract class Key
abstract def bytes
delegate to_slice, to: @bytes
def to_base64
Base64.encode(bytes)
end
def self.from_base64(encoded_key)
new(Base64.decode(encoded_key))
end
end
end