Koni Marti
3f7f7a0aa7
base64: use url encoding with updated api
...
Ensure that the URL alphabet for base64 is used with the urlencode
functions (urlencode, urlencode_buffer, urlencode_temp and
urlencode_new) are used. Add a new test.
2024-11-25 11:44:24 +01:00
Koni Marti
8d03aafe72
base32: update base32 api
...
Update the base32 api to be consistent with the recent changes to the
base64 api introduced by commit 60101830 ("Updated base64 encoding
api").
2024-11-25 11:43:40 +01:00
Koni Marti
b0c0fd7dc8
encoding: implement hex encoding (base16)
...
Implement hex encoding and decoding (base16) according to RFC 4648.
Add unit tests.
Link: https://www.rfc-editor.org/rfc/rfc4648
2024-11-25 11:41:22 +01:00
Christoffer Lerno
60101830cc
Updated base64 encoding api.
2024-11-24 00:14:31 +01:00
Koni Marti
9b94c1dda9
fix: base64 decoding
...
Fix the base64 decoding. If there's an 'A' character in the encoded
text, the base64 decode function returns an INVALID_PADDING error. The
reason lies in the way Base64Decoder.init tries to find a suitable
invalid character. Fix this by defining the invalid character as 0xff
(which is already the case for a decoding without padding).
This error has not been caught by the test harness, because no test
contains an 'A' character in the the encoded text yet. Add a new test.
2024-11-23 23:06:44 +01:00
konimarti
8154e275fa
encoding: implement RFC4648 base32 encoding ( #1596 )
...
Implement base32 encoding and decoding according to RFC 4648 with the
standard and extended hex alphabets. Add unit tests.
Link: https://www.rfc-editor.org/rfc/rfc4648
Signed-off-by: Koni Marti <koni.marti@gmail.com >
---------
Signed-off-by: Koni Marti <koni.marti@gmail.com >
2024-11-04 12:19:28 +01:00
Koni Marti
2739c86881
Add csv unit tests
...
Add unit tests for std::encoding::csv.
Signed-off-by: Koni Marti <koni.marti@gmail.com >
2024-10-11 16:11:45 +02:00
Christoffer Lerno
a00fce516e
Added test and releasenotes for #1498 .
2024-09-29 11:23:40 +02:00
Christoffer Lerno
811cb2b95c
Add string methods to json, and fix issue in dstring when the formatter uses temp. Remove unnecessary use of temp allocator in to_format for json.
2024-08-10 19:13:58 +02:00
Pierre Curto
d61482dffc
fix Object.free ( #982 )
...
* lib/std/collections: add HashMap.@each_entry()
* lib/std/json: fix Object.free() when object is a map
* lib/std/collections: fix allocator use in Object.{set,set_at,append}
* lib/std: add char.from_hex
* lib/std/collections: print arrays and objects compactly
* lib/std/io: fix Formatter.vprintf result
* lib/std/io/stream: rename module for ByteBuffer
* lib/std/io/stream: make Scanner a Stream reader
* lib/std/io: make std{in,err,out} return File* if no libc
2023-09-12 13:49:52 +02:00
Christoffer Lerno
9a6d83f526
Updated stream API.
2023-09-03 01:14:15 +02:00
Pierre Curto
c09b6154f4
std/lib/collections: add Object.get_len(); add some tests for encoding/json
...
Signed-off-by: Pierre Curto <pierre.curto@gmail.com >
2023-08-26 13:24:23 +02:00
Christoffer Lerno
ed70f39da8
Update the json API
2023-08-19 00:53:28 +02:00
Christoffer Lerno
fedffc2f35
Name change, some updates using "from end" indexing.
2023-06-24 15:20:40 +02:00
Pierre Curto
55a1f794cf
lib/std/encoding: add base64 support
...
Signed-off-by: Pierre Curto <pierre.curto@gmail.com >
2023-06-24 14:23:18 +02:00
Christoffer Lerno
809321e20c
Updated grammar. Removal of elif. Removal of ':' ';' in some ct statements. Empty faults is now an error. Remove "define" for types. Remove "private". Better errors on incorrect bitstruct syntax. Introduction of wildcard type rather than optional wildcard. Removal of scaled vector type. mkdir and rmdir. Disallow define @Foo() = { @inline }. Add handling for @optreturn and change it to @return!. Restrict interface style functions. Updated x64 ABI. stdlib updates to string. Removed deprecated functions. Update how variadics are implemented. Extended error messages. x86 ABI fixes. Shift check fixes. '!' and '?' are flipped. No trailing ',' allowed in functions. Fix to string parsing. Allow l suffix. Simplifying flatpath. any replaces variant, anyfault replaces anyerr. Allow getting the underlying type of anyfault. De-duplicate string constants. Fix of readme. Extended list. Fix of "(MyEnum)x + 1". Clock and DateTime types. Fixes to array concat.
2023-04-21 10:56:39 +02:00
Christoffer Lerno
7008dab113
Add primitive and incomplete object printout. First version of json parser.
2023-03-07 09:53:01 +01:00