aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpukkamustard <pukkamustard@posteo.net>2020-10-27 08:24:05 +0100
committerpukkamustard <pukkamustard@posteo.net>2020-10-27 08:24:05 +0100
commit8c0f863e2e9c7ac80da5d44fec1e3cde2ee422c4 (patch)
tree20f104367968b7bdbc161bc81b78eff68994bed8
parentca9c3ba6024e512de13d5dedebb4b8d09e80cd52 (diff)
eris.adoc: add "Hail ERIS!" example
-rw-r--r--doc/eris.adoc4
-rw-r--r--public/index.html8
-rw-r--r--tests/eris.scm12
3 files changed, 20 insertions, 4 deletions
diff --git a/doc/eris.adoc b/doc/eris.adoc
index 5e02f30..40234b2 100644
--- a/doc/eris.adoc
+++ b/doc/eris.adoc
@@ -340,6 +340,10 @@ TODO using 1 byte to encode level limits size of content that can be encoded. Ad
A read-capability can be encoded as an URN: `urn:eris:BASE32-READ-CAPABILITY`, where `BASE32-READ-CAPABILITY` is the unpadded Base32 <<RFC4648>> encoding of the read capability.
+For example the ERIS URN of the UTF-8 encoded string "Hail ERIS!" (with block size 1Kb and null convergence secret):
+
+`urn:erisx2:AAAAV4OIFHWY67XFEHAOQVXUOWTYDVG5TEY6S6IW4PJ4SQLVJJF4MIKNDLKUDPPHDCKLBUIAJQ3U2IEARRPFHEHWFW5NJY7BJUGFESPGDQ`
+
== Applications
=== Storage and Transport Layers
diff --git a/public/index.html b/public/index.html
index 12bd134..c977bec 100644
--- a/public/index.html
+++ b/public/index.html
@@ -1432,6 +1432,12 @@ ERIS-Decode(BLOCK-SIZE, LEVEL, ROOT-REFERENCE, ROOT-KEY):
<div class="paragraph">
<p>A read-capability can be encoded as an URN: <code>urn:eris:BASE32-READ-CAPABILITY</code>, where <code>BASE32-READ-CAPABILITY</code> is the unpadded Base32 <a href="#RFC4648">[RFC4648]</a> encoding of the read capability.</p>
</div>
+<div class="paragraph">
+<p>For example the ERIS URN of the UTF-8 encoded string "Hail ERIS!" (with block size 1Kb and null convergence secret):</p>
+</div>
+<div class="paragraph">
+<p><code>urn:erisx2:AAAAV4OIFHWY67XFEHAOQVXUOWTYDVG5TEY6S6IW4PJ4SQLVJJF4MIKNDLKUDPPHDCKLBUIAJQ3U2IEARRPFHEHWFW5NJY7BJUGFESPGDQ</code></p>
+</div>
</div>
</div>
</div>
@@ -1537,7 +1543,7 @@ ERIS-Decode(BLOCK-SIZE, LEVEL, ROOT-REFERENCE, ROOT-KEY):
</div>
<div id="footer">
<div id="footer-text">
-Last updated 2020-10-26 20:35:26 +0100
+Last updated 2020-10-27 08:13:03 +0100
</div>
</div>
</body>
diff --git a/tests/eris.scm b/tests/eris.scm
index e93e5b4..06345d9 100644
--- a/tests/eris.scm
+++ b/tests/eris.scm
@@ -30,14 +30,20 @@
(test-begin "eris")
+
+(test-equal
+ "Hail ERIS! is encoded propertly"
+ (eris-encode-uri (open-bytevector-input-port (string->utf8 "Hail ERIS!")))
+ "urn:erisx2:AAAAV4OIFHWY67XFEHAOQVXUOWTYDVG5TEY6S6IW4PJ4SQLVJJF4MIKNDLKUDPPHDCKLBUIAJQ3U2IEARRPFHEHWFW5NJY7BJUGFESPGDQ")
+
(generator-for-each
(lambda (bv)
(let-values (((urn _) (eris-encode (open-bytevector-input-port bv)
- #:block-storage my-store
- #:convergence-secret my-convergence-secret
- #:block-size (* 32 1024))))
+ #:block-storage my-store
+ #:convergence-secret my-convergence-secret
+ #:block-size (* 32 1024))))
(test-assert "decoded bytevector is same as initial bytevector"