Add Credential Issuer tutorial

Adds a code sample and a code walkthrough explaining how to build a
service that issues Credentials (XLS-70) on the XRP Ledger.

Credential issuer: Clarify/revise documents field

Issue credentials code sample: fix bugs

Apply suggestions from @oeggert review

Co-authored-by: oeggert <117319296+oeggert@users.noreply.github.com>

Credential Issuer: more edits for clarity
This commit is contained in:
mDuo13
2024-11-08 11:18:29 -08:00
parent 725391388a
commit 359e598a8b
10 changed files with 827 additions and 0 deletions

View File

@@ -0,0 +1,14 @@
from binascii import unhexlify
def decode_hex(s_hex):
"""
Try decoding a hex string as ASCII; return the decoded string on success,
or the un-decoded string prefixed by '(BIN) ' on failure.
"""
try:
s = unhexlify(s_hex).decode("ascii")
# Could use utf-8 instead, but it has more edge cases.
# Optionally, sanitize the string for display before returning
except:
s = "(BIN) "+s_hex
return s