Home Reference Source
import {Converter} from 'packages/crypto/src/converter.ts'
public class | source

Converter

Static Method Summary

Static Public Methods
public static

checkBytesToIntInput(bytes: undefined, numBytes: undefined, opt_startIndex: undefined): *

public static
public static

convertByteArrayToBigInteger(bytes: undefined, opt_startIndex: undefined): *

public static
public static
public static

convertByteArrayToSignedInt32(bytes: undefined, opt_startIndex: undefined): *

public static

convertByteArrayToSignedShort(bytes: undefined, opt_startIndex: undefined): *

public static

convertByteArrayToString(bytes: undefined, opt_startIndex: undefined, length: undefined): *

public static
public static
public static
public static
public static
public static
public static
public static
public static
public static

convertUint8ArrayToWordArray(u8Array: undefined): {"sigBytes": *, "words": *}

public static
public static
public static
public static
public static

int32ToBytes(x: undefined, opt_bigEndian: undefined): *

public static

intToBytes_(x: undefined, numBytes: undefined, unsignedMax: undefined, opt_bigEndian: undefined): *

Produces an array of the specified number of bytes to represent the integer value.

Static Public Methods

public static checkBytesToIntInput(bytes: undefined, numBytes: undefined, opt_startIndex: undefined): * source

Params:

NameTypeAttributeDescription
bytes undefined
numBytes undefined
opt_startIndex undefined

Return:

*

public static convertBinaryStringToUint8Array(bStr: undefined): * source

Params:

NameTypeAttributeDescription
bStr undefined

Return:

*

public static convertByteArrayToBigInteger(bytes: undefined, opt_startIndex: undefined): * source

Params:

NameTypeAttributeDescription
bytes undefined
opt_startIndex undefined

Return:

*

public static convertByteArrayToHexString(bytes: undefined): * source

Params:

NameTypeAttributeDescription
bytes undefined

Return:

*

public static convertByteArrayToShortArray(byteArray: undefined): * source

Params:

NameTypeAttributeDescription
byteArray undefined

Return:

*

public static convertByteArrayToSignedInt32(bytes: undefined, opt_startIndex: undefined): * source

Params:

NameTypeAttributeDescription
bytes undefined
opt_startIndex undefined

Return:

*

public static convertByteArrayToSignedShort(bytes: undefined, opt_startIndex: undefined): * source

Params:

NameTypeAttributeDescription
bytes undefined
opt_startIndex undefined

Return:

*

public static convertByteArrayToString(bytes: undefined, opt_startIndex: undefined, length: undefined): * source

Params:

NameTypeAttributeDescription
bytes undefined
opt_startIndex undefined
length undefined

Return:

*

public static convertByteArrayToWordArray(ba: undefined): * source

Params:

NameTypeAttributeDescription
ba undefined

Return:

*

public static convertHexStringToByteArray(hex: undefined): * source

Params:

NameTypeAttributeDescription
hex undefined

Return:

*

public static convertHexStringToString(hex: undefined): * source

Params:

NameTypeAttributeDescription
hex undefined

Return:

*

public static convertShortArrayToByteArray(shortArray: undefined): * source

Params:

NameTypeAttributeDescription
shortArray undefined

Return:

*

public static convertShortArrayToHexString(ary: undefined): * source

Params:

NameTypeAttributeDescription
ary undefined

Return:

*

public static convertStringToByteArray(str: undefined): * source

Params:

NameTypeAttributeDescription
str undefined

Return:

*

public static convertStringToHexString(str: undefined): * source

Params:

NameTypeAttributeDescription
str undefined

Return:

*

public static convertTimestampToDate(timestamp: number): * source

Params:

NameTypeAttributeDescription
timestamp number

Return:

*

public static convertUint8ArrayToBinaryString(u8Array: undefined): * source

Params:

NameTypeAttributeDescription
u8Array undefined

Return:

*

public static convertUint8ArrayToWordArray(u8Array: undefined): {"sigBytes": *, "words": *} source

Params:

NameTypeAttributeDescription
u8Array undefined

Return:

{"sigBytes": *, "words": *}

public static convertWordArrayToByteArray(wordArray: undefined, length: undefined): * source

Params:

NameTypeAttributeDescription
wordArray undefined
length undefined

Return:

*

public static convertWordArrayToUint8Array(wordArray: undefined): * source

Params:

NameTypeAttributeDescription
wordArray undefined

Return:

*

public static convertWordToByteArray(word: undefined, length: undefined): * source

Params:

NameTypeAttributeDescription
word undefined
length undefined

Return:

*

public static initialize() source

public static int32ToBytes(x: undefined, opt_bigEndian: undefined): * source

Params:

NameTypeAttributeDescription
x undefined
opt_bigEndian undefined

Return:

*

public static intToBytes_(x: undefined, numBytes: undefined, unsignedMax: undefined, opt_bigEndian: undefined): * source

Produces an array of the specified number of bytes to represent the integer value. Default output encodes ints in little endian format. Handles signed as well as unsigned integers. Due to limitations in JavaScript's number format, x cannot be a true 64 bit integer (8 bytes).

Params:

NameTypeAttributeDescription
x undefined
numBytes undefined
unsignedMax undefined
opt_bigEndian undefined

Return:

*