mybase 1.0.41 → 1.0.42
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 +1 -1
- package/mybase.js +5 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -36,7 +36,7 @@ var { isLocal } = require('mybase')
|
|
|
36
36
|
### Geoip2Paths() : boolean | object
|
|
37
37
|
### arrayRandomItem(array,defaultValue=false)
|
|
38
38
|
### maxmindOpen(geoipFile) : <Promise>
|
|
39
|
-
|
|
39
|
+
### utcnow():int
|
|
40
40
|
## Encryption
|
|
41
41
|
### decryptAES_CBC_NOIV(encryptedHex, encryptionKey)
|
|
42
42
|
### encryptAES_CBC_NOIV(plainString, encryptionKey)
|
package/mybase.js
CHANGED
|
@@ -44,6 +44,10 @@ function arrayRandomItem(arry,defaultValue=false) {
|
|
|
44
44
|
return defaultValue
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
+
function utcnow() {
|
|
48
|
+
return Math.floor(Date.now() / 1000)
|
|
49
|
+
}
|
|
50
|
+
|
|
47
51
|
function validIp(str) {
|
|
48
52
|
if (str && typeof str==='string') {
|
|
49
53
|
let splitted
|
|
@@ -599,5 +603,6 @@ module.exports = {
|
|
|
599
603
|
ensureProperty,
|
|
600
604
|
arrayRandomItem,
|
|
601
605
|
promiseTimeout,
|
|
606
|
+
utcnow,
|
|
602
607
|
Geoip2Paths
|
|
603
608
|
}
|