Skip to content

Commit

Permalink
FEAT: debase accepting any-string! for it's value
Browse files Browse the repository at this point in the history
  • Loading branch information
Oldes committed Mar 26, 2021
1 parent 9419f2f commit e9b0bb1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/boot/natives.reb
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ construct: native [

debase: native [
{Decodes binary-coded string to binary value.}
value [binary! string!] {The string to decode}
value [binary! any-string!] {The string to decode}
base [integer!] {Binary base to use: 85, 64, 16, or 2}
/url {Base 64 Decoding with URL and Filename Safe Alphabet}
/part {Limit the length of the input}
Expand Down
7 changes: 7 additions & 0 deletions src/tests/units/enbase-test.r3
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,13 @@ Rebol [
--assert strict-equal?
"A multi-line\nstring"
to string! debase "41206d756c74692d6c696e655c6e737472696e67" 16
--test-- "debase other strings"
;@@ https://github.com/Oldes/Rebol-issues/issues/2453
--assert #{1234} = debase "1234" 16
--assert #{1234} = debase <1234> 16
--assert #{1234} = debase @1234 16
--assert #{01} = debase @00000001 2


===end-group===

Expand Down

0 comments on commit e9b0bb1

Please sign in to comment.