0.6.0-beta.6 • Published 3 years ago

@burstjs/util v0.6.0-beta.6

Weekly downloads
4
License
Apache-2.0
Repository
github
Last release
3 years ago

@burstjs/util

Useful utilities and tools for building Burstcoin applications

Installation

@burstjs/http can be used with NodeJS or Web. Two formats are available

Using with NodeJS and/or modern web frameworks

Install using npm:

npm install @burstjs/util

or using yarn:

yarn add @burstjs/util

Example

import {convertNumberToNQTString} from '@burstjs/util'

const value = convertNumberToNQTString(1000)
console.log(value)

Using in classic <script>

Each package is available as bundled standalone library using IIFE. This way burstJS can be used also within <script>-Tags. This might be useful for Wordpress and/or other PHP applications.

Just import the package using the HTML <script> tag.

<script src='https://cdn.jsdelivr.net/npm/@burstjs/util/dist/util.crypto.min.js'></script>

Example

const value = b$util.convertNumberToNQTString(1000)
console.log(value)

See more here:

@burstjs/util Online Documentation


API Reference

Modules

Constants

Functions

util

util

util

util

util

util

util

util ⇒

Returns: The numeric id, or undefined if address is invalid

ParamDescription
addressThe BURST address

util ⇒ string

Returns: string - The orginal string

ParamDescription
b64The string to be decoded (either URI encoded or not)

util ⇒

Deprecated

Returns: Date

ParamDescription
burstTimestampThe numeric Id

util ⇒

Deprecated

Returns: Unix Epoch Time (milliseconds since 01.01.1970)

ParamDescription
burstTimestampThe numeric Id

util ⇒ string

Returns: string - A hex string representing the byte array input

ParamDescription
bytesThe (unsigned) byte array to be converted
uppercaseIf true, converts hex string with uppercase characters (Default: false)

util ⇒ string

Returns: string - The converted string

ParamDescription
byteArrayThe byte array to be converted
startIndexThe starting index of array to be converted (Default: 0)
lengthThe number of bytes to be considered, iff startIndex is given. If null the byte array's length is considered

util ⇒

Deprecated

Returns: The Burst Timestamp

ParamDescription
dateThe date to be converted

util ⇒

Returns: A hexadecimal string
Note:: Negative numbers are expressed as Two's Complement (https://en.wikipedia.org/wiki/Two%27s_complement) Credits to AJ ONeal for the two's complements stuff https://coolaj86.com/articles/convert-decimal-to-hex-with-js-bigints/

ParamDescription
decimalA decimal string or BigNumber representation
paddingIf set the hex string will be padded to given number, 8 or 16 or more

util ⇒

Returns: The converted string as hex string

ParamDescription
hexStringThe hex string to be converted

util ⇒ Array.<number>

Returns: Array.<number> - An byte array representing the hexadecimal input

ParamDescription
hexThe hexadecimal string to be converted

util ⇒

Returns: A decimal string

ParamDescription
hexStrA hexadecimal string

util ⇒ string

Returns: string - The string represented by the Hex String

ParamDescription
hexThe Hex string to be converted

util ⇒

Deprecated

Returns: A number expressed in Burst (not NQT)
Throws:

ParamDescription
amountThe amount in Planck (aka NQT)

util ⇒

Deprecated

Returns: a NQT number string

ParamDescription
nthe number

util ⇒

Returns: the BURST address in Reed-Solomon encoding, or undefined if passed null, undefined

ParamDescription
numericIdThe numeric Id

util ⇒ string

Returns: string - The Base64 String representing the input string. The string is already URI encoded, i.e. can be used directly in browsers

ParamDescription
strThe string to be converted
isURICompatibleDetermine whether the resulting string shall be URI compatible, or not. Default is true

util ⇒ Array.<number>

Returns: Array.<number> - A byte array representing the string input

ParamDescription
strThe string to be converted

util ⇒ string

Returns: string - The Hex String representing the input string

ParamDescription
strThe Hex string to be converted

util ⇒

Returns: The Deeplink
See: [parseDeeplink] as inverse function

ParamTypeDescription
argsCreateDeeplinkArgsThe arguments for the deeplink

util

util ⇒ boolean

Returns: boolean - true, if is a valid address, else false
Internal: Check for valid Burst address (format: BURST-XXXX-XXXX-XXXX-XXXXX, XXXX-XXXX-XXXX-XXXXX)

ParamTypeDescription
addressstringThe address

util ⇒ boolean

Returns: boolean - true, if is a valid address, else false

ParamTypeDescription
addressstringThe address

util ⇒

Returns: The parsed deeplink parts.
Throws:

See: [createDeeplink] as inverse function

ParamTypeDescription
deeplinkstringThe deeplink to be parsed

util

util ⇒

Deprecated

Returns: The sum of all amounts in BURST

ParamDescription
nqtsVariable amount list with NQT string

MandatoryPattern

Kind: global constant

twosComplementBinary(bn)

Kind: global function
Internal:

Param
bn

encodePayload()

Kind: global function
Internal:

0.6.0-beta.6

3 years ago

0.6.0-beta.5

3 years ago

0.6.0-beta.4

3 years ago

0.6.0-beta.3

3 years ago

0.6.0-beta.2

3 years ago

0.6.0-beta.1

3 years ago

0.6.0-alpha.9

3 years ago

0.6.0-alpha.8

3 years ago

0.6.0-alpha.7

3 years ago

0.6.0-alpha.6

3 years ago

0.6.0-alpha.5

3 years ago

0.6.0-alpha.4

3 years ago

0.6.0-alpha.2

3 years ago

0.6.0-alpha.1

3 years ago

0.5.1

4 years ago

0.5.0

4 years ago

0.5.0-beta.12

4 years ago

0.5.0-beta.11

4 years ago

0.5.0-beta.10

4 years ago

0.5.0-beta.9

4 years ago

0.5.0-beta.8

4 years ago

0.5.0-beta.7

4 years ago

0.5.0-beta.6

4 years ago

0.5.0-beta.5

4 years ago

0.5.0-beta.4

4 years ago

0.5.0-beta.3

4 years ago

0.5.0-beta.2

4 years ago

0.5.0-beta.1

4 years ago

0.5.0-alpha.3

4 years ago

0.5.0-alpha.2

4 years ago

0.5.0-alpha.1

4 years ago

0.5.0-alpha.0

4 years ago

0.4.3

4 years ago

0.4.2

4 years ago

0.4.1

4 years ago

0.4.0

5 years ago

0.3.1

5 years ago

0.3.0

5 years ago

0.2.1

5 years ago

0.2.0

5 years ago

0.1.3

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0-rc.3.2

5 years ago

0.1.0-rc.3.1

5 years ago

0.1.0-rc.3

5 years ago

0.1.0-rc.2

5 years ago

0.1.0-rc1

5 years ago

0.0.14

5 years ago

0.0.13

5 years ago

0.0.12

5 years ago