From ddb25e94961f0eb9f5f615db83b316d3c222da81 Mon Sep 17 00:00:00 2001 From: ame Date: Mon, 25 Dec 2023 15:10:09 -0600 Subject: arbitrary base convertions --- docs/crypto.md | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'docs/crypto.md') diff --git a/docs/crypto.md b/docs/crypto.md index 01fe7be..997ede9 100644 --- a/docs/crypto.md +++ b/docs/crypto.md @@ -77,3 +77,14 @@ all functions have 1 argument which is a string, unless noted otherwise llib.crypto.base64encode("purr") -- cHVycg== llib.crypto.base64decode("cHVycg==") -- purr ``` + +## baseconvert + +'accepts an array of integers + +converts an array from base N to base T (in reversed order) + +```lua +-- input N T +llib.crypto.baseconvert({1, 1, 0, 1, 0, 1, 0, 0, 0, 1}, 2, 10) -- {9, 4, 8} (which is 849) +``` -- cgit v1.2.3