![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
@iota/validators
Advanced tools
Collection of guards and validators, useful in IOTA development.
Collection of guards and validators, useful in IOTA development.
Instal using npm:
npm install @iota/validators
or using yarn:
yarn add @iota/validators
Summary: Validates the checksum of the given address.
Param | Type | Description |
---|---|---|
address | string | Address with a checksum |
This method takes an address with a checksum and validates that the checksum is correct.
To generate a new address with a checksum, use the getNewAddress()
method.
Returns: boolean
- valid - Whether the checksum is valid
Example
let valid = Validator.isAddress('9FNJWLMBECSQDKHQAGDHDPXBMZFMQIMAFAUIQTDECJVGKJBKHLEBVU9TWCTPRJGYORFDSYENIQKBVSYKW9NSLGS9UW');
Param | Type |
---|---|
input | any |
Checks if input is an Int8Array
of trit values; -1, 0, 1
.
Param | Type |
---|---|
trits | Int8Array |
Checks if trits are NULL.
Param | Type | Default |
---|---|---|
trytes | string | |
[length] | string | number | "'1,'" |
Checks if input is correct trytes consisting of [9A-Z]; optionally validate length
Param | Type |
---|---|
trytes | string |
length | number |
Param | Type |
---|---|
trytes | string |
length | number |
Param | Type |
---|---|
hash | string |
Checks if input contains 9
s only.
Param | Type |
---|---|
hash | string |
Checks if input is correct hash (81 trytes) or address with checksum (90 trytes)
Param | Type |
---|---|
address | string |
Checks if input is valid input object. Address can be passed with or without checksum. It does not validate the checksum.
Param | Type |
---|---|
tag | string |
Checks that input is valid tag trytes.
Param | Type |
---|---|
transfer | Transfer |
Checks if input is valid transfer
object.
Param | Type |
---|---|
uri | string |
Checks that a given URI
is valid
Valid Examples:
udp://[2001:db8:a0b:12f0::1]:14265
udp://[2001:db8:a0b:12f0::1]
udp://8.8.8.8:14265
udp://domain.com
udp://domain2.com:14265
Throws:
Error
errorRuns each validator in sequence, and throws on the first occurence of invalid data.
Validators are passed as arguments and executed in given order.
You might want place validate()
in promise chains before operations that require valid inputs,
taking advantage of built-in promise branching.
Example
try {
validate([
value, // Given value
isTrytes, // Validator function
'Invalid trytes' // Error message
])
} catch (err) {
console.log(err.message) // 'Invalid trytes'
}
FAQs
Collection of guards and validators, useful in IOTA development.
The npm package @iota/validators receives a total of 4,195 weekly downloads. As such, @iota/validators popularity was classified as popular.
We found that @iota/validators demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 6 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.