boho 1.0.0 → 1.0.2
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/README.md +3 -8
- package/dist/{boho.iife.js → boho.min.js} +4 -4
- package/dist/boho.min.js.map +1 -0
- package/package.json +5 -5
- package/rollup.config.js +2 -2
- package/test/RAND.cjs +18 -0
- package/test/RAND.js +2 -1
- package/test-browser/index.html +1 -1
- package/test-browser/loader.html +6 -5
- package/dist/boho.iife.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "boho",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "Encryption, authentication, Secure communication",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
7
7
|
"import": "./dist/boho.js",
|
|
8
8
|
"require": "./dist/boho.cjs"
|
|
9
9
|
},
|
|
10
|
-
"browser": "./dist/boho.js",
|
|
10
|
+
"browser": "./dist/boho.min.js",
|
|
11
|
+
"jsdelivr": "./dist/boho.min.js",
|
|
12
|
+
"unpkg": "./dist/boho.min.js",
|
|
11
13
|
"keywords": [
|
|
12
14
|
"SSL",
|
|
13
15
|
"cipher",
|
|
@@ -29,13 +31,11 @@
|
|
|
29
31
|
"devDependencies": {
|
|
30
32
|
"@rollup/plugin-commonjs": "^26.0.1",
|
|
31
33
|
"@rollup/plugin-node-resolve": "^15.2.3",
|
|
32
|
-
"@rollup/plugin-replace": "^5.0.7",
|
|
33
34
|
"@rollup/plugin-terser": "^0.4.4",
|
|
34
35
|
"rollup": "^4.21.2"
|
|
35
36
|
},
|
|
36
37
|
"dependencies": {
|
|
37
|
-
"buffer": "^
|
|
38
|
-
"meta-buffer-pack": "^2.0.1"
|
|
38
|
+
"meta-buffer-pack": "^2.0.3"
|
|
39
39
|
},
|
|
40
40
|
"scripts": {
|
|
41
41
|
"build": "rollup -c",
|
package/rollup.config.js
CHANGED
package/test/RAND.cjs
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
const { describe, it } = require('node:test');
|
|
2
|
+
const assert = require('node:assert');
|
|
3
|
+
const Boho = require('boho')
|
|
4
|
+
|
|
5
|
+
describe('RAND cjs', function () {
|
|
6
|
+
describe('for number', function () {
|
|
7
|
+
const num = 16
|
|
8
|
+
it('should return Uint8Array', function () {
|
|
9
|
+
assert.ok(Boho.RAND(num) instanceof Uint8Array)
|
|
10
|
+
})
|
|
11
|
+
|
|
12
|
+
it('should return number-bytes size of Uint8Array', function () {
|
|
13
|
+
assert.ok(Boho.RAND(num).byteLength === num)
|
|
14
|
+
})
|
|
15
|
+
})
|
|
16
|
+
})
|
|
17
|
+
|
|
18
|
+
console.log( 'buffer: hello', Boho.Buffer.from('hello'))
|
package/test/RAND.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
// import assert from 'assert/strict'
|
|
2
1
|
import { describe, it } from 'node:test';
|
|
3
2
|
import assert from 'node:assert';
|
|
4
3
|
import Boho from 'boho'
|
|
@@ -15,3 +14,5 @@ describe('RAND ESM', function () {
|
|
|
15
14
|
})
|
|
16
15
|
})
|
|
17
16
|
})
|
|
17
|
+
|
|
18
|
+
console.log( 'buffer: hello', Boho.Buffer.from('hello'))
|
package/test-browser/index.html
CHANGED
package/test-browser/loader.html
CHANGED
|
@@ -7,12 +7,13 @@
|
|
|
7
7
|
<title>Document</title>
|
|
8
8
|
</head>
|
|
9
9
|
<body>
|
|
10
|
-
<p>this page
|
|
11
|
-
<h1>1. IIFE: boho.min.js</h1>
|
|
10
|
+
<p>this page includes: </p>
|
|
11
|
+
<h1>1. UMD(IIFE): ../dist/boho.min.js</h1>
|
|
12
12
|
<p>use global name: Boho </p>
|
|
13
|
-
<p>Boho has props: sha256, Buffer, RAND , MBP
|
|
14
|
-
<h1>2. ES Module: boho.
|
|
15
|
-
|
|
13
|
+
<p>Boho has props: sha256, Buffer, RAND , MBP. </p>
|
|
14
|
+
<h1>2. ES Module: ../dist/boho.js</h1>
|
|
15
|
+
|
|
16
|
+
<script src="../dist/boho.min.js"></script>
|
|
16
17
|
<script>
|
|
17
18
|
// console.log( Boho )
|
|
18
19
|
console.log('min.js: sha256.hash("hi")', Boho.sha256.hash('hi'))
|