@lumjs/encode 1.0.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -2
- package/README.md +4 -0
- package/lib/base64.js +1 -1
- package/lib/index.js +13 -17
- package/package.json +2 -2
- package/ub-dev.js +0 -11
package/CHANGELOG.md
CHANGED
|
@@ -6,10 +6,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
6
6
|
|
|
7
7
|
## [Unreleased]
|
|
8
8
|
|
|
9
|
+
## [1.1.0] - 2022-10-18
|
|
10
|
+
### Changed
|
|
11
|
+
- Added a link to the PHP version in the README.
|
|
12
|
+
- Bumped `@lumjs/core` to `1.7.1`.
|
|
13
|
+
- Refactored default module to use `ModuleBuilder` and lazy-loading.
|
|
14
|
+
### Fixed
|
|
15
|
+
- A typo in a DocBlock.
|
|
16
|
+
|
|
9
17
|
## [1.0.0] - 2022-09-30
|
|
10
18
|
### Added
|
|
11
19
|
- Initial release.
|
|
12
20
|
|
|
13
|
-
[Unreleased]: https://github.com/supernovus/lum.encode.js/compare/v1.
|
|
21
|
+
[Unreleased]: https://github.com/supernovus/lum.encode.js/compare/v1.1.0...HEAD
|
|
22
|
+
[1.1.0]: https://github.com/supernovus/lum.encode.js/compare/v1.0.0...v1.1.0
|
|
14
23
|
[1.0.0]: https://github.com/supernovus/lum.encode.js/releases/tag/v1.0.0
|
|
15
|
-
|
package/README.md
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
A bunch of encoding libraries.
|
|
4
4
|
|
|
5
|
+
Among other things, it offers a pure JS implementation of my
|
|
6
|
+
[Safe64](https://github.com/supernovus/lum.encode.php)
|
|
7
|
+
data serialization and encoding format.
|
|
8
|
+
|
|
5
9
|
## Official URLs
|
|
6
10
|
|
|
7
11
|
This library can be found in two places:
|
package/lib/base64.js
CHANGED
|
@@ -44,7 +44,7 @@ exports.encode = function(rawdata, stringFormat=Utf8)
|
|
|
44
44
|
*
|
|
45
45
|
* If this is `false`, we'll return a `WordArray` object.
|
|
46
46
|
*
|
|
47
|
-
* @return {(string|WordArray)
|
|
47
|
+
* @return {(string|WordArray)} The decoded output.
|
|
48
48
|
*/
|
|
49
49
|
exports.decode = function(string, stringFormat=Utf8)
|
|
50
50
|
{
|
package/lib/index.js
CHANGED
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
* @module @lumjs/encode
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
+
const {can,from} = require('@lumjs/core').buildModule(module);
|
|
7
|
+
|
|
6
8
|
/**
|
|
7
9
|
* @name module:@lumjs/encode.ord
|
|
8
10
|
* @function
|
|
@@ -14,40 +16,34 @@
|
|
|
14
16
|
* @function
|
|
15
17
|
* @see {@link module:@lumjs/encode/util.numByteArray}
|
|
16
18
|
*/
|
|
17
|
-
|
|
18
|
-
const {ord, numByteArray} = require('./util');
|
|
19
|
+
from('./util', 'ord', 'numByteArray');
|
|
19
20
|
|
|
20
21
|
/**
|
|
22
|
+
* @name module:@lumjs/encode.Base64
|
|
21
23
|
* @see {@link module:@lumjs/encode/base64}
|
|
22
|
-
* @alias module:@lumjs/encode.Base64
|
|
23
24
|
*/
|
|
24
|
-
|
|
25
|
+
can('Base64', true);
|
|
25
26
|
|
|
26
27
|
/**
|
|
28
|
+
* @name module:@lumjs/encode.Base91
|
|
27
29
|
* @see {@link module:@lumjs/encode/base91}
|
|
28
|
-
* @alias module:@lumjs/encode.Base91
|
|
29
30
|
*/
|
|
30
|
-
|
|
31
|
+
can('Base91', true);
|
|
31
32
|
|
|
32
33
|
/**
|
|
34
|
+
* @name module:@lumjs/encode.Safe64
|
|
33
35
|
* @see {@link module:@lumjs/encode/safe64}
|
|
34
|
-
* @alias module:@lumjs/encode.Safe64
|
|
35
36
|
*/
|
|
36
|
-
|
|
37
|
+
can('Safe64', true);
|
|
37
38
|
|
|
38
39
|
/**
|
|
40
|
+
* @name module:@lumjs/encode.Hash
|
|
39
41
|
* @see {@link module:@lumjs/encode/hash}
|
|
40
|
-
* @alias module:@lumjs/encode.Hash
|
|
41
42
|
*/
|
|
42
|
-
|
|
43
|
+
can('Hash', true);
|
|
43
44
|
|
|
44
45
|
/**
|
|
46
|
+
* @name module:@lumjs/encode.Crypto
|
|
45
47
|
* @see {@link module:@lumjs/encode/crypto}
|
|
46
|
-
* @alias module:@lumjs/encode.Crypto
|
|
47
48
|
*/
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
module.exports = exports =
|
|
51
|
-
{
|
|
52
|
-
ord, numByteArray, Base64, Safe64, Base91, Hash, Crypto,
|
|
53
|
-
}
|
|
49
|
+
can('Crypto', true);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lumjs/encode",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"main": "lib/index.js",
|
|
5
5
|
"exports":
|
|
6
6
|
{
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"url": "https://github.com/supernovus/lum.encode.js.git"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@lumjs/core": "^1.
|
|
25
|
+
"@lumjs/core": "^1.7.1",
|
|
26
26
|
"crypto-js": "^4.1.1",
|
|
27
27
|
"php-serialize": "^4.0.2",
|
|
28
28
|
"@shelacek/ubjson": "^1.1.1"
|
package/ub-dev.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
const UB = require('@shelacek/ubjson');
|
|
4
|
-
|
|
5
|
-
const data = {hello:["world","darkness my old friend"]};
|
|
6
|
-
const ubj = UB.encode(data);
|
|
7
|
-
|
|
8
|
-
console.log("Size:", ubj.byteLength);
|
|
9
|
-
const utf8 = new TextDecoder().decode(ubj);
|
|
10
|
-
console.log("UTF-8:", utf8);
|
|
11
|
-
console.log("JSON:", JSON.stringify(utf8));
|