Skip to content

Commit e9b0bb1

Browse files
committed
FEAT: debase accepting any-string! for it's value
resolves: Oldes/Rebol-issues#2453
1 parent 9419f2f commit e9b0bb1

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

src/boot/natives.reb

+1-1
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ construct: native [
394394

395395
debase: native [
396396
{Decodes binary-coded string to binary value.}
397-
value [binary! string!] {The string to decode}
397+
value [binary! any-string!] {The string to decode}
398398
base [integer!] {Binary base to use: 85, 64, 16, or 2}
399399
/url {Base 64 Decoding with URL and Filename Safe Alphabet}
400400
/part {Limit the length of the input}

src/tests/units/enbase-test.r3

+7
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,13 @@ Rebol [
9797
--assert strict-equal?
9898
"A multi-line\nstring"
9999
to string! debase "41206d756c74692d6c696e655c6e737472696e67" 16
100+
--test-- "debase other strings"
101+
;@@ https://github.com/Oldes/Rebol-issues/issues/2453
102+
--assert #{1234} = debase "1234" 16
103+
--assert #{1234} = debase <1234> 16
104+
--assert #{1234} = debase @1234 16
105+
--assert #{01} = debase @00000001 2
106+
100107

101108
===end-group===
102109

0 commit comments

Comments
 (0)