@conecli/cone-render 0.8.15-taroUpdate.1 → 0.8.15-taroUpdate.3
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/dist/common/index.ts +1 -1
- package/dist/common/index.weapp.ts +1 -1
- package/dist/common/wxappApi.ts +1 -1
- package/dist/components/base/InOrOutViewObserver/index.module.scss +0 -0
- package/dist/components/base/InOrOutViewObserver/index.tsx +1 -0
- package/dist/components/base/InViewRender/index.tsx +1 -1
- package/dist/interface/common.ts +1 -1
- package/dist/open/components/index.ts +1 -1
- package/dist/utils/connectNativeJsBridge.weapp.ts +1 -0
- package/dist/wxapp/common/JD.js +1 -0
- package/dist/wxapp/common/finger-report/index.js +1 -0
- package/dist/wxapp/common/request/params-sign.js +1 -0
- package/dist/wxapp/libs/sha256.js +191 -0
- package/package.json +2 -1
package/dist/common/index.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import Taro from '@tarojs/taro'
|
|
2
1
|
public config: object | null
|
|
3
2
|
this.config = {}
|
|
4
3
|
console.log('=================>', 'updateBusinessDomainAndApi')
|
|
4
|
+
import Taro from '@tarojs/taro'
|
|
5
5
|
public config: object | null
|
|
6
6
|
this.config = {}
|
|
7
7
|
console.log('=================>', 'updateBusinessDomainAndApi')
|
package/dist/common/wxappApi.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import * as WXAPP_LOGIN from '../wxapp/common/login/login.js'
|
|
1
|
+
import * as WXAPP_LOGIN from '../wxapp/common/login/login.js'
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import Taro from '@tarojs/taro'
|
|
2
|
TaroEventType,
|
|
1
3
|
const {
|
|
2
4
|
children,
|
|
3
5
|
inViewCallback,
|
|
4
6
|
outViewCallback
|
|
5
7
|
} = props
|
|
6
8
|
const [componentShowState, setComponentShowState] = useState(false)
|
|
7
9
|
const componentObserverRef = useRef<HTMLElement | null>(null)
|
|
8
10
|
const componentShowStateRef = useRef(false)
|
|
9
11
|
if (isH5AndJdShopView) {
|
|
10
12
|
useEffect(() => {
|
|
11
13
|
const latestRes = latestFromNativeMsgStorage[TaroEventType.PAGE_SCROLL] || {}
|
|
12
14
|
dealPageScrollInfo(latestRes)
|
|
13
15
|
Taro.eventCenter.on(TaroEventType.PAGE_SCROLL, (res) => {
|
|
14
16
|
dealPageScrollInfo(res)
|
|
15
17
|
})
|
|
16
18
|
}, [])
|
|
17
19
|
useEffect(() => {
|
|
18
20
|
if (componentShowState) {
|
|
19
21
|
typeof inViewCallback === 'function' && inViewCallback()
|
|
20
22
|
console.log('app=>in可视区域')
|
|
21
23
|
} else {
|
|
22
24
|
typeof outViewCallback === 'function' && outViewCallback()
|
|
23
25
|
console.log('app=>out可视区域')
|
|
24
26
|
}
|
|
25
27
|
}, [componentShowState])
|
|
26
28
|
|
|
27
29
|
const handleInOrOutView = (type: boolean) => {
|
|
28
30
|
componentShowStateRef.current = type
|
|
29
31
|
setComponentShowState(type)
|
|
30
32
|
}
|
|
31
33
|
|
|
32
34
|
const dealPageScrollInfo = (res) => {
|
|
33
35
|
const { displayHeight, offSetY } = res
|
|
34
36
|
if (componentObserverRef.current) {
|
|
35
37
|
const eleClientRect =
|
|
36
38
|
componentObserverRef.current.getBoundingClientRect()
|
|
37
39
|
const eleOffsetTop = Math.ceil(eleClientRect.top)
|
|
38
40
|
const eleHeight = Math.ceil(eleClientRect.height)
|
|
39
41
|
console.log('==========================eleOffsetTop, eleHeight', eleOffsetTop, eleHeight)
|
|
40
42
|
if (eleOffsetTop >= 0 && eleOffsetTop < displayHeight) {
|
|
41
43
|
const isOutView = offSetY > eleOffsetTop + eleHeight
|
|
42
44
|
handleInOrOutView(isOutView ? false : true)
|
|
43
45
|
} else {
|
|
44
46
|
const isInView = (offSetY > eleOffsetTop - displayHeight) && (offSetY < eleOffsetTop + eleHeight)
|
|
45
47
|
handleInOrOutView(isInView ? true : false)
|
|
46
48
|
}
|
|
47
49
|
}
|
|
48
50
|
}
|
|
49
51
|
return (
|
|
50
52
|
<View ref={componentObserverRef}>
|
|
51
53
|
{children}
|
|
52
54
|
</View>
|
|
53
55
|
)
|
|
54
56
|
} else {
|
|
55
57
|
const rootDom = document.querySelector('#J_shopHomeRoot')
|
|
56
58
|
console.log('rootDom', rootDom)
|
|
57
59
|
const { ref, inView } = useInView({
|
|
58
60
|
threshold: 0,
|
|
59
61
|
triggerOnce: false,
|
|
60
62
|
root: rootDom || null,
|
|
61
63
|
rootMargin: `0px 0px 0px 0px`,
|
|
62
64
|
})
|
|
63
65
|
useEffect(() => {
|
|
64
66
|
if (inView) {
|
|
65
67
|
typeof inViewCallback === 'function' && inViewCallback()
|
|
66
68
|
console.log('其他h5=>in可视区域')
|
|
67
69
|
} else {
|
|
68
70
|
typeof outViewCallback === 'function' && outViewCallback()
|
|
69
71
|
console.log('其他h5=>out可视区域')
|
|
70
72
|
}
|
|
71
73
|
}, [inView])
|
|
72
74
|
return (
|
|
73
75
|
<View ref={ref}>
|
|
74
76
|
{children}
|
|
75
77
|
</View>
|
|
76
78
|
)
|
|
77
79
|
}
|
|
78
80
|
children: null,
|
|
79
81
|
className: '',
|
|
80
82
|
inViewCallback: null,
|
|
81
83
|
outViewCallback: null
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import Taro from '@tarojs/taro'
|
|
2
1
|
inViewCallback
|
|
3
2
|
if (isH5AndJdShopView) {
|
|
4
3
|
useEffect(() => {
|
|
5
4
|
const latestRes = latestFromNativeMsgStorage[TaroEventType.PAGE_SCROLL] || {}
|
|
6
5
|
!componentShowStateRef.current && dealPageScrollInfo(latestRes)
|
|
7
6
|
Taro.eventCenter.on(TaroEventType.PAGE_SCROLL, (res) => {
|
|
8
7
|
!componentShowStateRef.current && dealPageScrollInfo(res)
|
|
9
8
|
})
|
|
10
9
|
}, [])
|
|
11
10
|
useEffect(() => {
|
|
12
11
|
if(componentShowState){
|
|
13
12
|
typeof inViewCallback === 'function' && inViewCallback()
|
|
14
13
|
console.log('InViewRender -- 店铺H5 展示啦!')
|
|
15
14
|
}
|
|
16
15
|
}, [componentShowState])
|
|
17
16
|
|
|
18
17
|
const dealPageScrollInfo = (res) => {
|
|
19
18
|
if (componentLazyRef.current) {
|
|
20
19
|
const eleClientRect =
|
|
21
20
|
componentLazyRef.current.getBoundingClientRect()
|
|
22
21
|
const getContainerHeightOffSetY = res.displayHeight + res.offSetY
|
|
23
22
|
const eleOffsetTop = Math.ceil(eleClientRect.top)
|
|
24
23
|
if (!componentShowStateRef.current) {
|
|
25
24
|
if (getContainerHeightOffSetY > eleOffsetTop) {
|
|
26
25
|
componentShowStateRef.current = true
|
|
27
26
|
setComponentShowState(true)
|
|
28
27
|
Taro.nextTick(() => {
|
|
29
28
|
setComponentRenderShowState(true)
|
|
30
29
|
})
|
|
31
30
|
}
|
|
32
31
|
}
|
|
33
32
|
}
|
|
34
33
|
}
|
|
35
34
|
return (
|
|
36
35
|
<View
|
|
37
36
|
ref={componentLazyRef}
|
|
38
37
|
className={classNames(
|
|
39
38
|
lazyLayoutLoadStyle['d-app-floor-lazy-layout-load'],
|
|
40
39
|
'd-app-floor-lazy-load',
|
|
41
40
|
)}
|
|
42
41
|
style={{
|
|
43
42
|
minHeight: `${
|
|
44
43
|
componentRenderShowState ? 'auto' : height + (typeof height === 'number'? 'px': '')
|
|
45
44
|
}`,
|
|
46
45
|
backgroundColor: componentRenderShowState
|
|
47
46
|
? 'transparent'
|
|
48
47
|
: '#ffffff',
|
|
49
48
|
}}
|
|
50
49
|
>
|
|
51
50
|
{componentShowState ? children : placeholder}
|
|
52
51
|
</View>
|
|
53
52
|
)
|
|
54
53
|
} else {
|
|
55
54
|
const rootDom = document.querySelector('#J_shopHomeRoot')
|
|
56
55
|
const { ref, inView } = useInView({
|
|
57
56
|
threshold: 0,
|
|
58
57
|
triggerOnce: true,
|
|
59
58
|
root: rootDom,
|
|
60
59
|
rootMargin: `0px 0px 0px 0px`,
|
|
61
60
|
})
|
|
62
61
|
useEffect(() => {
|
|
63
62
|
if(inView){
|
|
64
63
|
typeof inViewCallback === 'function' && inViewCallback()
|
|
65
64
|
console.log('InViewRender -- 其它H5 展示啦!')
|
|
66
65
|
}
|
|
67
66
|
}, [inView])
|
|
68
67
|
return (
|
|
69
68
|
<View
|
|
70
69
|
ref={ref}
|
|
71
70
|
style={{
|
|
72
71
|
minHeight: `${inView ? 'auto' : height + 'px'}`,
|
|
73
72
|
backgroundColor: 'transparent',
|
|
74
73
|
}}
|
|
75
74
|
>
|
|
76
75
|
{inView ? children : placeholder}
|
|
77
76
|
</View>
|
|
78
77
|
)
|
|
79
78
|
}
|
|
80
79
|
inViewCallback: null,
|
|
80
|
+
import Taro from '@tarojs/taro'
|
|
81
81
|
TaroEventType,
|
|
82
82
|
const {
|
|
83
83
|
children,
|
|
84
84
|
placeholder,
|
|
85
85
|
height,
|
|
86
86
|
inViewCallback
|
|
87
87
|
} = props
|
|
88
88
|
const [componentShowState, setComponentShowState] = useState(false)
|
|
89
89
|
const [componentRenderShowState, setComponentRenderShowState] =
|
|
90
90
|
useState(false)
|
|
91
91
|
const componentLazyRef = useRef<HTMLElement | null>(null)
|
|
92
92
|
const componentShowStateRef = useRef(false)
|
|
93
93
|
if (isH5AndJdShopView) {
|
|
94
94
|
useEffect(() => {
|
|
95
95
|
const latestRes = latestFromNativeMsgStorage[TaroEventType.PAGE_SCROLL] || {}
|
|
96
96
|
!componentShowStateRef.current && dealPageScrollInfo(latestRes)
|
|
97
97
|
Taro.eventCenter.on(TaroEventType.PAGE_SCROLL, (res) => {
|
|
98
98
|
!componentShowStateRef.current && dealPageScrollInfo(res)
|
|
99
99
|
})
|
|
100
100
|
}, [])
|
|
101
101
|
useEffect(() => {
|
|
102
102
|
if (componentShowState) {
|
|
103
103
|
typeof inViewCallback === 'function' && inViewCallback()
|
|
104
104
|
console.log('InViewRender -- 店铺H5 展示啦!')
|
|
105
105
|
}
|
|
106
106
|
}, [componentShowState])
|
|
107
107
|
|
|
108
108
|
const dealPageScrollInfo = (res) => {
|
|
109
109
|
if (componentLazyRef.current) {
|
|
110
110
|
const eleClientRect =
|
|
111
111
|
componentLazyRef.current.getBoundingClientRect()
|
|
112
112
|
const getContainerHeightOffSetY = res.displayHeight + res.offSetY
|
|
113
113
|
const eleOffsetTop = Math.ceil(eleClientRect.top)
|
|
114
114
|
if (!componentShowStateRef.current) {
|
|
115
115
|
if (getContainerHeightOffSetY > eleOffsetTop) {
|
|
116
116
|
componentShowStateRef.current = true
|
|
117
117
|
setComponentShowState(true)
|
|
118
118
|
Taro.nextTick(() => {
|
|
119
119
|
setComponentRenderShowState(true)
|
|
120
120
|
})
|
|
121
121
|
}
|
|
122
122
|
}
|
|
123
123
|
}
|
|
124
124
|
}
|
|
125
125
|
return (
|
|
126
126
|
<View
|
|
127
127
|
ref={componentLazyRef}
|
|
128
128
|
className={classNames(
|
|
129
129
|
lazyLayoutLoadStyle['d-app-floor-lazy-layout-load'],
|
|
130
130
|
'd-app-floor-lazy-load',
|
|
131
131
|
)}
|
|
132
132
|
style={{
|
|
133
133
|
minHeight: `${componentRenderShowState ? 'auto' : height + (typeof height === 'number' ? 'px' : '')
|
|
134
134
|
}`,
|
|
135
135
|
backgroundColor: componentRenderShowState
|
|
136
136
|
? 'transparent'
|
|
137
137
|
: '#ffffff',
|
|
138
138
|
}}
|
|
139
139
|
>
|
|
140
140
|
{componentShowState ? children : placeholder}
|
|
141
141
|
</View>
|
|
142
142
|
)
|
|
143
143
|
} else {
|
|
144
144
|
const rootDom = document.querySelector('#J_shopHomeRoot')
|
|
145
145
|
const { ref, inView } = useInView({
|
|
146
146
|
threshold: 0,
|
|
147
147
|
triggerOnce: true,
|
|
148
148
|
root: rootDom || null,
|
|
149
149
|
rootMargin: `0px 0px 0px 0px`,
|
|
150
150
|
})
|
|
151
151
|
useEffect(() => {
|
|
152
152
|
if (inView) {
|
|
153
153
|
typeof inViewCallback === 'function' && inViewCallback()
|
|
154
154
|
console.log('InViewRender -- 其它H5 展示啦!')
|
|
155
155
|
}
|
|
156
156
|
}, [inView])
|
|
157
157
|
return (
|
|
158
158
|
<View
|
|
159
159
|
ref={ref}
|
|
160
160
|
style={{
|
|
161
161
|
minHeight: `${inView ? 'auto' : height + 'px'}`,
|
|
162
162
|
backgroundColor: 'transparent',
|
|
163
163
|
}}
|
|
164
164
|
>
|
|
165
165
|
{inView ? children : placeholder}
|
|
166
166
|
</View>
|
|
167
167
|
)
|
|
168
168
|
}
|
|
169
169
|
children: null,
|
|
170
170
|
placeholder: null,
|
|
171
171
|
height: 1,
|
|
172
172
|
className: '',
|
|
173
173
|
lazyNodeClassName: '',
|
|
174
174
|
inViewCallback: null,
|
package/dist/interface/common.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import Taro from '@tarojs/taro'
|
|
1
|
+
import Taro from '@tarojs/taro'
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import Taro from "@tarojs/taro";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import ParamsSign from "@legos/js-security-jdxcx";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
class FingerReport {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const paramsSign = ({data}) => {
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* Secure Hash Algorithm (SHA256)
|
|
4
|
+
* http://www.webtoolkit.info/
|
|
5
|
+
*
|
|
6
|
+
* Original code by Angel Marin, Paul Johnston.
|
|
7
|
+
*
|
|
8
|
+
**/
|
|
9
|
+
/* eslint-disable */
|
|
10
|
+
function SHA256(s) {
|
|
11
|
+
var chrsz = 8
|
|
12
|
+
var hexcase = 0
|
|
13
|
+
function safe_add(x, y) {
|
|
14
|
+
var lsw = (x & 0xffff) + (y & 0xffff)
|
|
15
|
+
var msw = (x >> 16) + (y >> 16) + (lsw >> 16)
|
|
16
|
+
return (msw << 16) | (lsw & 0xffff)
|
|
17
|
+
}
|
|
18
|
+
function S(X, n) {
|
|
19
|
+
return (X >>> n) | (X << (32 - n))
|
|
20
|
+
}
|
|
21
|
+
function R(X, n) {
|
|
22
|
+
return X >>> n
|
|
23
|
+
}
|
|
24
|
+
function Ch(x, y, z) {
|
|
25
|
+
return (x & y) ^ (~x & z)
|
|
26
|
+
}
|
|
27
|
+
function Maj(x, y, z) {
|
|
28
|
+
return (x & y) ^ (x & z) ^ (y & z)
|
|
29
|
+
}
|
|
30
|
+
function Sigma0256(x) {
|
|
31
|
+
return S(x, 2) ^ S(x, 13) ^ S(x, 22)
|
|
32
|
+
}
|
|
33
|
+
function Sigma1256(x) {
|
|
34
|
+
return S(x, 6) ^ S(x, 11) ^ S(x, 25)
|
|
35
|
+
}
|
|
36
|
+
function Gamma0256(x) {
|
|
37
|
+
return S(x, 7) ^ S(x, 18) ^ R(x, 3)
|
|
38
|
+
}
|
|
39
|
+
function Gamma1256(x) {
|
|
40
|
+
return S(x, 17) ^ S(x, 19) ^ R(x, 10)
|
|
41
|
+
}
|
|
42
|
+
function core_sha256(m, l) {
|
|
43
|
+
var K = new Array(
|
|
44
|
+
0x428a2f98,
|
|
45
|
+
0x71374491,
|
|
46
|
+
0xb5c0fbcf,
|
|
47
|
+
0xe9b5dba5,
|
|
48
|
+
0x3956c25b,
|
|
49
|
+
0x59f111f1,
|
|
50
|
+
0x923f82a4,
|
|
51
|
+
0xab1c5ed5,
|
|
52
|
+
0xd807aa98,
|
|
53
|
+
0x12835b01,
|
|
54
|
+
0x243185be,
|
|
55
|
+
0x550c7dc3,
|
|
56
|
+
0x72be5d74,
|
|
57
|
+
0x80deb1fe,
|
|
58
|
+
0x9bdc06a7,
|
|
59
|
+
0xc19bf174,
|
|
60
|
+
0xe49b69c1,
|
|
61
|
+
0xefbe4786,
|
|
62
|
+
0xfc19dc6,
|
|
63
|
+
0x240ca1cc,
|
|
64
|
+
0x2de92c6f,
|
|
65
|
+
0x4a7484aa,
|
|
66
|
+
0x5cb0a9dc,
|
|
67
|
+
0x76f988da,
|
|
68
|
+
0x983e5152,
|
|
69
|
+
0xa831c66d,
|
|
70
|
+
0xb00327c8,
|
|
71
|
+
0xbf597fc7,
|
|
72
|
+
0xc6e00bf3,
|
|
73
|
+
0xd5a79147,
|
|
74
|
+
0x6ca6351,
|
|
75
|
+
0x14292967,
|
|
76
|
+
0x27b70a85,
|
|
77
|
+
0x2e1b2138,
|
|
78
|
+
0x4d2c6dfc,
|
|
79
|
+
0x53380d13,
|
|
80
|
+
0x650a7354,
|
|
81
|
+
0x766a0abb,
|
|
82
|
+
0x81c2c92e,
|
|
83
|
+
0x92722c85,
|
|
84
|
+
0xa2bfe8a1,
|
|
85
|
+
0xa81a664b,
|
|
86
|
+
0xc24b8b70,
|
|
87
|
+
0xc76c51a3,
|
|
88
|
+
0xd192e819,
|
|
89
|
+
0xd6990624,
|
|
90
|
+
0xf40e3585,
|
|
91
|
+
0x106aa070,
|
|
92
|
+
0x19a4c116,
|
|
93
|
+
0x1e376c08,
|
|
94
|
+
0x2748774c,
|
|
95
|
+
0x34b0bcb5,
|
|
96
|
+
0x391c0cb3,
|
|
97
|
+
0x4ed8aa4a,
|
|
98
|
+
0x5b9cca4f,
|
|
99
|
+
0x682e6ff3,
|
|
100
|
+
0x748f82ee,
|
|
101
|
+
0x78a5636f,
|
|
102
|
+
0x84c87814,
|
|
103
|
+
0x8cc70208,
|
|
104
|
+
0x90befffa,
|
|
105
|
+
0xa4506ceb,
|
|
106
|
+
0xbef9a3f7,
|
|
107
|
+
0xc67178f2
|
|
108
|
+
)
|
|
109
|
+
var HASH = new Array(0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19)
|
|
110
|
+
var W = new Array(64)
|
|
111
|
+
var a, b, c, d, e, f, g, h, i, j
|
|
112
|
+
var T1, T2
|
|
113
|
+
m[l >> 5] |= 0x80 << (24 - (l % 32))
|
|
114
|
+
m[(((l + 64) >> 9) << 4) + 15] = l
|
|
115
|
+
for (var i = 0; i < m.length; i += 16) {
|
|
116
|
+
a = HASH[0]
|
|
117
|
+
b = HASH[1]
|
|
118
|
+
c = HASH[2]
|
|
119
|
+
d = HASH[3]
|
|
120
|
+
e = HASH[4]
|
|
121
|
+
f = HASH[5]
|
|
122
|
+
g = HASH[6]
|
|
123
|
+
h = HASH[7]
|
|
124
|
+
for (var j = 0; j < 64; j++) {
|
|
125
|
+
if (j < 16) W[j] = m[j + i]
|
|
126
|
+
else W[j] = safe_add(safe_add(safe_add(Gamma1256(W[j - 2]), W[j - 7]), Gamma0256(W[j - 15])), W[j - 16])
|
|
127
|
+
T1 = safe_add(safe_add(safe_add(safe_add(h, Sigma1256(e)), Ch(e, f, g)), K[j]), W[j])
|
|
128
|
+
T2 = safe_add(Sigma0256(a), Maj(a, b, c))
|
|
129
|
+
h = g
|
|
130
|
+
g = f
|
|
131
|
+
f = e
|
|
132
|
+
e = safe_add(d, T1)
|
|
133
|
+
d = c
|
|
134
|
+
c = b
|
|
135
|
+
b = a
|
|
136
|
+
a = safe_add(T1, T2)
|
|
137
|
+
}
|
|
138
|
+
HASH[0] = safe_add(a, HASH[0])
|
|
139
|
+
HASH[1] = safe_add(b, HASH[1])
|
|
140
|
+
HASH[2] = safe_add(c, HASH[2])
|
|
141
|
+
HASH[3] = safe_add(d, HASH[3])
|
|
142
|
+
HASH[4] = safe_add(e, HASH[4])
|
|
143
|
+
HASH[5] = safe_add(f, HASH[5])
|
|
144
|
+
HASH[6] = safe_add(g, HASH[6])
|
|
145
|
+
HASH[7] = safe_add(h, HASH[7])
|
|
146
|
+
}
|
|
147
|
+
return HASH
|
|
148
|
+
}
|
|
149
|
+
function str2binb(str) {
|
|
150
|
+
var bin = Array()
|
|
151
|
+
var mask = (1 << chrsz) - 1
|
|
152
|
+
for (var i = 0; i < str.length * chrsz; i += chrsz) {
|
|
153
|
+
bin[i >> 5] |= (str.charCodeAt(i / chrsz) & mask) << (24 - (i % 32))
|
|
154
|
+
}
|
|
155
|
+
return bin
|
|
156
|
+
}
|
|
157
|
+
function Utf8Encode(string) {
|
|
158
|
+
string = string.replace(/\r\n/g, '\n')
|
|
159
|
+
var utftext = ''
|
|
160
|
+
for (var n = 0; n < string.length; n++) {
|
|
161
|
+
var c = string.charCodeAt(n)
|
|
162
|
+
if (c < 128) {
|
|
163
|
+
utftext += String.fromCharCode(c)
|
|
164
|
+
} else if (c > 127 && c < 2048) {
|
|
165
|
+
utftext += String.fromCharCode((c >> 6) | 192)
|
|
166
|
+
utftext += String.fromCharCode((c & 63) | 128)
|
|
167
|
+
} else {
|
|
168
|
+
utftext += String.fromCharCode((c >> 12) | 224)
|
|
169
|
+
utftext += String.fromCharCode(((c >> 6) & 63) | 128)
|
|
170
|
+
utftext += String.fromCharCode((c & 63) | 128)
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
return utftext
|
|
174
|
+
}
|
|
175
|
+
function binb2hex(binarray) {
|
|
176
|
+
var hex_tab = hexcase ? '0123456789ABCDEF' : '0123456789abcdef'
|
|
177
|
+
var str = ''
|
|
178
|
+
for (var i = 0; i < binarray.length * 4; i++) {
|
|
179
|
+
str +=
|
|
180
|
+
hex_tab.charAt((binarray[i >> 2] >> ((3 - (i % 4)) * 8 + 4)) & 0xf) +
|
|
181
|
+
hex_tab.charAt((binarray[i >> 2] >> ((3 - (i % 4)) * 8)) & 0xf)
|
|
182
|
+
}
|
|
183
|
+
return str
|
|
184
|
+
}
|
|
185
|
+
s = Utf8Encode(s)
|
|
186
|
+
return binb2hex(core_sha256(str2binb(s), s.length * chrsz))
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
module.exports = {
|
|
190
|
+
sha256_digest: SHA256,
|
|
191
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@conecli/cone-render",
|
|
3
|
-
"version": "0.8.15-taroUpdate.
|
|
3
|
+
"version": "0.8.15-taroUpdate.3",
|
|
4
4
|
"private": false,
|
|
5
5
|
"files": [
|
|
6
6
|
"dist/"
|
|
@@ -47,6 +47,7 @@
|
|
|
47
47
|
"dev:quickapp": "npm run build:quickapp -- --watch",
|
|
48
48
|
"compressWatch": "gulp compressWatch --gulpfile ./publish/gulpfile.js",
|
|
49
49
|
"compress": "gulp compress --gulpfile ./publish/gulpfile.js",
|
|
50
|
+
"build": "npm run compress",
|
|
50
51
|
"check": "gulp check --gulpfile ./publish/gulpfile.js"
|
|
51
52
|
},
|
|
52
53
|
"browserslist": [
|