Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- trait Text {
- val text:List[Int]
- override def toString: String
- def xor(other:Text) = {
- val xorText = (text zip other.text) map { case (a,b) => a^b }
- }
- }
- class PlainText(val text:List[Int]) extends Text {
- override def toString: String = text.map(_.toChar).mkString(" ")
- }
- class CypherText(val text:List[Int]) extends Text {
- override def toString: String = text.map("%x".format(_)).mkString(" ")
- }
Advertisement
Add Comment
Please, Sign In to add comment