aboutsummaryrefslogtreecommitdiffstats
path: root/src/tests/data/codec
diff options
context:
space:
mode:
Diffstat (limited to 'src/tests/data/codec')
-rw-r--r--src/tests/data/codec/base32.vec79
-rw-r--r--src/tests/data/codec/base58.vec68
-rw-r--r--src/tests/data/codec/base58c.vec24
-rw-r--r--src/tests/data/codec/base64.vec73
4 files changed, 244 insertions, 0 deletions
diff --git a/src/tests/data/codec/base32.vec b/src/tests/data/codec/base32.vec
new file mode 100644
index 000000000..c681d85d1
--- /dev/null
+++ b/src/tests/data/codec/base32.vec
@@ -0,0 +1,79 @@
+
+[valid]
+# empty string
+Binary =
+Base32 =
+
+Binary = 66
+Base32 = MY======
+
+Binary = 666F
+Base32 = MZXQ====
+
+Binary = 666F6F
+Base32 = MZXW6===
+
+Binary = 666F6F66
+Base32 = MZXW6ZQ=
+
+Binary = 666F6F666F
+Base32 = MZXW6ZTP
+
+Binary = 68656C6C6F20776F726C64
+Base32 = NBSWY3DPEB3W64TMMQ======
+
+Binary = 68656C6C6F20776F726C6421
+Base32 = NBSWY3DPEB3W64TMMQQQ====
+
+Binary = 48656C6C6F2C20776F726C642E
+Base32 = JBSWY3DPFQQHO33SNRSC4===
+
+Binary = 546865203132206368617273
+Base32 = KRUGKIBRGIQGG2DBOJZQ====
+
+Binary = 5468652031332063686172732E
+Base32 = KRUGKIBRGMQGG2DBOJZS4===
+
+Binary = 5468652031342063686172732E2E
+Base32 = KRUGKIBRGQQGG2DBOJZS4LQ=
+
+Binary = 5468652031352063686172732E2E2E
+Base32 = KRUGKIBRGUQGG2DBOJZS4LRO
+
+Binary = 416E205554462D382075756D6C3A20C3BC
+Base32 = IFXCAVKUIYWTQIDVOVWWYORAYO6A====
+
+Binary = 5765697264204765726D616E20322062797465207468696E673A20C39F2E
+Base32 = K5SWS4TEEBDWK4TNMFXCAMRAMJ4XIZJAORUGS3THHIQMHHZO
+
+Binary = 9B
+Base32 = TM======
+
+Binary = 1C60
+Base32 = DRQA====
+
+Binary = 8134BD
+Base32 = QE2L2===
+
+Binary = 5E6CFFDE
+Base32 = LZWP7XQ=
+
+Binary = b2cdf0dc7f
+Base32 = WLG7BXD7
+
+Binary = fc562ddad40e
+Base32 = 7RLC3WWUBY======
+
+Binary = 29b2322e8841e8
+Base32 = FGZDELUIIHUA====
+
+Binary = 0f0fced9497aaf92
+Base32 = B4H45WKJPKXZE===
+
+Binary = 270fb18982800da640
+Base32 = E4H3DCMCQAG2MQA=
+
+[invalid]
+Base32 = ZOOL!isnotvalidbase32
+
+Base32 = Neitheris:this?
diff --git a/src/tests/data/codec/base58.vec b/src/tests/data/codec/base58.vec
new file mode 100644
index 000000000..6c8d30fcc
--- /dev/null
+++ b/src/tests/data/codec/base58.vec
@@ -0,0 +1,68 @@
+
+# Test data from https://github.com/nham/rust-base58/blob/master/src/lib.rs
+
+[valid]
+
+Binary =
+Base58 =
+
+Binary = 20
+Base58 = Z
+
+Binary = 2d
+Base58 = n
+
+Binary = 30
+Base58 = q
+
+Binary = 31
+Base58 = r
+
+Binary = 39
+Base58 = z
+
+Binary = 2D31
+Base58 = 4SU
+
+Binary = 3131
+Base58 = 4k8
+
+Binary = 616263
+Base58 = ZiCa
+
+Binary = 31323334353938373630
+Base58 = 3mJr7AoUXx2Wqd
+
+Binary = 6162636465666768696a6b6c6d6e6f707172737475767778797a
+Base58 = 3yxU3u1igY8WkgtjK92fbJQCd4BZiiT1v25f
+
+Binary = 00010966776006953D5567439E5E39F86A0D273BEED61967F6
+Base58 = 16UwLL9Risc3QfPqBUvKofHmBQ7wMtjvM
+
+Binary = 00616263
+Base58 = 1ZiCa
+
+Binary = 0000616263
+Base58 = 11ZiCa
+
+Binary = 000000616263
+Base58 = 111ZiCa
+
+Binary = 00000000616263
+Base58 = 1111ZiCa
+
+[invalid]
+
+Base58 = 0
+Base58 = O
+Base58 = I
+Base58 = l
+Base58 = 3mJr0
+Base58 = O3yxU
+Base58 = 3sNI
+Base58 = 4kl8
+Base58 = s!5<
+Base58 = t$@mX<*
+Base58 = AreYouEvenLookingAtThese?
+
+
diff --git a/src/tests/data/codec/base58c.vec b/src/tests/data/codec/base58c.vec
new file mode 100644
index 000000000..30ea5a840
--- /dev/null
+++ b/src/tests/data/codec/base58c.vec
@@ -0,0 +1,24 @@
+
+[valid]
+
+Binary =
+Base58 = 3QJmnh
+
+Binary = 31
+Base58 = 6bdbJ1U
+
+Binary = 00010966776006953D5567439E5E39F86A0D273BEE
+Base58 = 16UwLL9Risc3QfPqBUvKofHmBQ7wMtjvM
+
+Binary = 6162636465666768696a6b6c6d6e6f707172737475767778797a
+Base58 = LWmP1W82eUos2HWzVn19rapmig4X5dqPWgGFLsUTJ
+
+[invalid]
+
+Base58 = 3vQB7B6MrGQZaxCuFg4oH
+
+Base58 = 39QB7B6MrGQZaxCuFg4oH
+
+Base58 = 3mJr7AoUXx2Wqd
+Base58 = 3mJr7AoUXx2Wqd
+Base58 = 4SU
diff --git a/src/tests/data/codec/base64.vec b/src/tests/data/codec/base64.vec
new file mode 100644
index 000000000..e1aa028a0
--- /dev/null
+++ b/src/tests/data/codec/base64.vec
@@ -0,0 +1,73 @@
+
+[valid]
+# empty string
+Binary =
+Base64 =
+
+Binary = 66
+Base64 = Zg==
+
+Binary = 666F
+Base64 = Zm8=
+
+Binary = 666F6F
+Base64 = Zm9v
+
+Binary = 68656C6C6F20776F726C64
+Base64 = aGVsbG8gd29ybGQ=
+
+Binary = 68656C6C6F20776F726C6421
+Base64 = aGVsbG8gd29ybGQh
+
+Binary = 48656C6C6F2C20776F726C642E
+Base64 = SGVsbG8sIHdvcmxkLg==
+
+Binary = 546865203132206368617273
+Base64 = VGhlIDEyIGNoYXJz
+
+Binary = 5468652031332063686172732E
+Base64 = VGhlIDEzIGNoYXJzLg==
+
+Binary = 5468652031342063686172732E2E
+Base64 = VGhlIDE0IGNoYXJzLi4=
+
+Binary = 5468652031352063686172732E2E2E
+Base64 = VGhlIDE1IGNoYXJzLi4u
+
+Binary = 416E205554462D382075756D6C3A20C3BC
+Base64 = QW4gVVRGLTggdXVtbDogw7w=
+
+Binary = 5765697264204765726D616E20322062797465207468696E673A20C39F2E
+Base64 = V2VpcmQgR2VybWFuIDIgYnl0ZSB0aGluZzogw58u
+
+Binary = 9B
+Base64 = mw==
+
+Binary = 1C60
+Base64 = HGA=
+
+Binary = 8134BD
+Base64 = gTS9
+
+Binary = 5E6CFFDE
+Base64 = Xmz/3g==
+
+Binary = b2cdf0dc7f
+Base64 = ss3w3H8=
+
+Binary = fc562ddad40e
+Base64 = /FYt2tQO
+
+Binary = 29b2322e8841e8
+Base64 = KbIyLohB6A==
+
+Binary = 0f0fced9497aaf92
+Base64 = Dw/O2Ul6r5I=
+
+Binary = 270fb18982800da640
+Base64 = Jw+xiYKADaZA
+
+[invalid]
+Base64 = ZOOL!isnotvalidbase64
+
+Base64 = Neitheris:this?