aboutsummaryrefslogtreecommitdiff
path: root/examples/base64/base64.tm
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2024-11-19 13:30:45 -0500
committerBruce Hill <bruce@bruce-hill.com>2024-11-19 13:30:45 -0500
commit4720ca7a5f3ad4bf2a04a6d28d671f03162149a9 (patch)
treea6385a8ad6f03b869e768b91220b2033631d6764 /examples/base64/base64.tm
parentccada385c4fdc2dc320b0ab468c7413ff27bcc7d (diff)
Rename `Text.utf8_bytes` back to `Text.bytes`
Diffstat (limited to 'examples/base64/base64.tm')
-rw-r--r--examples/base64/base64.tm6
1 files changed, 3 insertions, 3 deletions
diff --git a/examples/base64/base64.tm b/examples/base64/base64.tm
index 2568a1d1..f3762628 100644
--- a/examples/base64/base64.tm
+++ b/examples/base64/base64.tm
@@ -1,6 +1,6 @@
# Base 64 encoding and decoding
-_enc := "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/":utf8_bytes()
+_enc := "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/":bytes()
_EQUAL_BYTE := Byte(0x3D)
@@ -26,7 +26,7 @@ _dec := [
lang Base64:
func parse(text:Text -> Base64?):
- return Base64.from_bytes(text:utf8_bytes())
+ return Base64.from_bytes(text:bytes())
func from_bytes(bytes:[Byte] -> Base64?):
output := [Byte(0) for _ in bytes.length * 4 / 3 + 4]
@@ -65,7 +65,7 @@ lang Base64:
return Text.from_bytes(b64:decode_bytes() or return !Text)
func decode_bytes(b64:Base64 -> [Byte]?):
- bytes := b64.text_content:utf8_bytes()
+ bytes := b64.text_content:bytes()
output := [Byte(0) for _ in bytes.length/4 * 3]
src := Int64(1)
dest := Int64(1)