@zilliqa-js/util
Advanced tools
Comparing version 0.5.0 to 0.6.0
import BN from 'bn.js'; | ||
import Long from 'long'; | ||
export declare const isAddress: (address: string) => boolean; | ||
export declare const isBech32: (raw: string) => boolean; | ||
export declare const isBase58: (raw: string) => boolean; | ||
export declare const isPrivateKey: (privateKey: string) => boolean; | ||
@@ -5,0 +7,0 @@ export declare const isPubKey: (pubKey: string) => boolean; |
@@ -9,2 +9,8 @@ "use strict"; | ||
}; | ||
exports.isBech32 = function (raw) { | ||
return !!raw.match(/^zil1[qpzry9x8gf2tvdw0s3jn54khce6mua7l]{38}/); | ||
}; | ||
exports.isBase58 = function (raw) { | ||
return !!raw.match(/^[1-9ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]+$/); | ||
}; | ||
exports.isPrivateKey = function (privateKey) { | ||
@@ -11,0 +17,0 @@ return exports.isByteString(privateKey, 64); |
{ | ||
"name": "@zilliqa-js/util", | ||
"version": "0.5.0", | ||
"version": "0.6.0", | ||
"description": "Utilities for working with Zillia.", | ||
@@ -26,3 +26,3 @@ "main": "dist/index.js", | ||
}, | ||
"gitHead": "c9ac41a9624e4797e8a94f8c1d7558bf96f92d25" | ||
"gitHead": "36aca1d0308845a83903e83de88eac3a8d92f1ed" | ||
} |
@@ -8,2 +8,12 @@ import BN from 'bn.js'; | ||
export const isBech32 = (raw: string) => { | ||
return !!raw.match(/^zil1[qpzry9x8gf2tvdw0s3jn54khce6mua7l]{38}/); | ||
}; | ||
export const isBase58 = (raw: string) => { | ||
return !!raw.match( | ||
/^[1-9ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]+$/, | ||
); | ||
}; | ||
export const isPrivateKey = (privateKey: string) => { | ||
@@ -10,0 +20,0 @@ return isByteString(privateKey, 64); |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1418453
9851