@@ -1414,6 +1414,19 @@ Bubble sort implementation.
14141414bubbleSort ([2 , 1 ]); // -> [1, 2]
14151415```
14161416
1417+ ## bytesToStr
1418+
1419+ Convert bytes to string.
1420+
1421+ | Name | Type | Desc |
1422+ | ------| ------| -------------|
1423+ | str | array | Bytes array |
1424+ | return| string| Result string|
1425+
1426+ ``` javascript
1427+ bytesToStr ([108 , 105 , 99 , 105 , 97 ]); // -> 'licia'
1428+ ```
1429+
14171430## callbackify
14181431
14191432Convert a function that returns a Promise to a function following the error-first callback style.
@@ -4600,6 +4613,29 @@ range(5); // -> [0, 1, 2, 3, 4]
46004613range (0 , 5 , 2 ) // -> [0, 2, 4]
46014614```
46024615
4616+ ## rc4
4617+
4618+ RC4 symmetric encryption implementation.
4619+
4620+ ### encrypt
4621+
4622+ RC4 encryption, result as base64 string.
4623+
4624+ ### decrypt
4625+
4626+ RC4 decryption, pass base64 string as input.
4627+
4628+ | Name | Type | Desc |
4629+ | ------| ------| --------------------------------|
4630+ | key | string| Secret key |
4631+ | str | string| String to be encrypted/decrypted|
4632+ | return| string| Encrypted/decrypted string |
4633+
4634+ ``` javascript
4635+ rc4 .encrypt (' licia' , ' Hello world' ); // -> 'j9y2VpSfR3AdNN8='
4636+ rc4 .decrypt (' licia' , ' j9y2VpSfR3AdNN8=' ); // -> 'Hello world'
4637+ ```
4638+
46034639## ready
46044640
46054641Invoke callback when dom is ready, similar to jQuery ready.
@@ -5075,6 +5111,19 @@ String hash function using djb2.
50755111strHash (' test' ); // -> 2090770981
50765112```
50775113
5114+ ## strToBytes
5115+
5116+ Convert string into bytes.
5117+
5118+ | Name | Type | Desc |
5119+ | ------| ------| -----------------|
5120+ | str | string| String to convert|
5121+ | return| array | Bytes array |
5122+
5123+ ``` javascript
5124+ strToBytes (' licia' ); // -> [108, 105, 99, 105, 97]
5125+ ```
5126+
50785127## stringify
50795128
50805129JSON stringify with support for circular object, function etc.
0 commit comments